update CMakeLists.txt file
This commit is contained in:
parent
49b3120ada
commit
00bbc86d39
114
CMakeLists.txt
114
CMakeLists.txt
@ -10,23 +10,23 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
# set(CMAKE_VERBOSE TRUE)
|
# set(CMAKE_VERBOSE TRUE)
|
||||||
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
|
||||||
set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0)
|
|
||||||
set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
||||||
|
|
||||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
|
||||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
|
||||||
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
|
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
|
||||||
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
|
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
|
||||||
if a different toolchain file is set externally" ON
|
if a different toolchain file is set externally" ON
|
||||||
)
|
)
|
||||||
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
|
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
# Perform steps like loading toolchain files where applicable.
|
||||||
|
include(PreProjectConfig)
|
||||||
|
pre_project_config()
|
||||||
|
|
||||||
set(OBSW_ADD_STAR_TRACKER 0)
|
# Project Name
|
||||||
set(OBSW_DEBUG_STARTRACKER 0)
|
project(eive-obsw)
|
||||||
|
|
||||||
|
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
|
||||||
|
set(OBSW_VERSION_MINOR_IF_GIT_FAILS 0)
|
||||||
|
set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
|
||||||
|
|
||||||
if(NOT FSFW_OSAL)
|
if(NOT FSFW_OSAL)
|
||||||
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
||||||
@ -44,10 +44,21 @@ else()
|
|||||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF)
|
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Perform steps like loading toolchain files where applicable.
|
|
||||||
include(PreProjectConfig)
|
|
||||||
include(EiveHelpers)
|
include(EiveHelpers)
|
||||||
pre_project_config()
|
|
||||||
|
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||||
|
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||||
|
|
||||||
|
set(OBSW_ADD_STAR_TRACKER 0)
|
||||||
|
set(OBSW_DEBUG_STARTRACKER 0)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Pre-Sources preparation
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Specify the C++ standard
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
# Version handling
|
# Version handling
|
||||||
set(GIT_VER_HANDLING_OK FALSE)
|
set(GIT_VER_HANDLING_OK FALSE)
|
||||||
@ -80,20 +91,27 @@ if(NOT GIT_VER_HANDLING_OK)
|
|||||||
set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
|
set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check whether the user has already installed Catch2 first. This has to come before
|
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
|
||||||
# the project call. We could also exclude doing this when the Q7S primary OBSW is built..
|
# Check whether the user has already installed Catch2 first
|
||||||
find_package(Catch2 3 CONFIG QUIET)
|
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
|
||||||
|
# Not installed, so use FetchContent to download and provide Catch2
|
||||||
|
if(NOT Catch2_FOUND)
|
||||||
|
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent")
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
# Project Name
|
FetchContent_Declare(
|
||||||
project(eive-obsw)
|
Catch2
|
||||||
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||||
|
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
|
||||||
|
)
|
||||||
|
|
||||||
################################################################################
|
FetchContent_MakeAvailable(Catch2)
|
||||||
# Pre-Sources preparation
|
#fixes regression -preview4, to be confirmed in later releases
|
||||||
################################################################################
|
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
||||||
|
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||||
# Specify the C++ standard
|
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
endif()
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
endif()
|
||||||
|
|
||||||
# Set names and variables
|
# Set names and variables
|
||||||
set(OBSW_NAME ${CMAKE_PROJECT_NAME})
|
set(OBSW_NAME ${CMAKE_PROJECT_NAME})
|
||||||
@ -253,30 +271,8 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|||||||
set(COMPILER_FLAGS "/permissive-")
|
set(COMPILER_FLAGS "/permissive-")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s"))
|
|
||||||
# Not installed, so use FetchContent to download and provide Catch2
|
|
||||||
if(NOT Catch2_FOUND)
|
|
||||||
message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it")
|
|
||||||
include(FetchContent)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
Catch2
|
|
||||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
||||||
GIT_TAG v3.0.0-preview4
|
|
||||||
)
|
|
||||||
|
|
||||||
FetchContent_MakeAvailable(Catch2)
|
|
||||||
#fixes regression -preview4, to be confirmed in later releases
|
|
||||||
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
|
|
||||||
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
|
|
||||||
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
add_library(${LIB_EIVE_MISSION})
|
add_library(${LIB_EIVE_MISSION})
|
||||||
|
|
||||||
|
|
||||||
# Add main executable
|
# Add main executable
|
||||||
add_executable(${OBSW_NAME})
|
add_executable(${OBSW_NAME})
|
||||||
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
||||||
@ -301,21 +297,16 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC
|
|||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
#unittests
|
# unittests
|
||||||
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(EIVE_ADD_ETL_LIB)
|
if(EIVE_ADD_ETL_LIB)
|
||||||
# add_subdirectory(${LIB_ETL_PATH})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EIVE_ADD_JSON_LIB)
|
if(EIVE_ADD_JSON_LIB)
|
||||||
add_subdirectory(${LIB_JSON_PATH})
|
add_subdirectory(${LIB_JSON_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(EIVE_ADD_LINUX_FILES)
|
if(EIVE_ADD_LINUX_FILES)
|
||||||
add_subdirectory(${LIB_ARCSEC_PATH})
|
add_subdirectory(${LIB_ARCSEC_PATH})
|
||||||
add_subdirectory(${LINUX_PATH})
|
add_subdirectory(${LINUX_PATH})
|
||||||
@ -325,26 +316,29 @@ if(ADD_CSP_LIB)
|
|||||||
add_subdirectory(${LIB_CSP_PATH})
|
add_subdirectory(${LIB_CSP_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(${COMMON_PATH})
|
add_subdirectory(${COMMON_PATH})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(${LIB_LWGPS_PATH})
|
add_subdirectory(${LIB_LWGPS_PATH})
|
||||||
add_subdirectory(${FSFW_PATH})
|
add_subdirectory(${FSFW_PATH})
|
||||||
add_subdirectory(${LIB_EIVE_MISSION_PATH})
|
add_subdirectory(${LIB_EIVE_MISSION_PATH})
|
||||||
add_subdirectory(${TEST_PATH})
|
add_subdirectory(${TEST_PATH})
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(${UNITTEST_PATH})
|
add_subdirectory(${UNITTEST_PATH})
|
||||||
|
|
||||||
|
# This should have already been downloaded by the FSFW
|
||||||
|
# Still include it to be safe
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
etl
|
||||||
|
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
||||||
|
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(etl)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Post-Sources preparation
|
# Post-Sources preparation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Add libraries
|
# Add libraries
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||||
${LIB_FSFW_NAME}
|
${LIB_FSFW_NAME}
|
||||||
@ -383,7 +377,7 @@ endif()
|
|||||||
|
|
||||||
if(EIVE_ADD_ETL_LIB)
|
if(EIVE_ADD_ETL_LIB)
|
||||||
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
|
||||||
${LIB_ETL_NAME}
|
etl
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 3d047f9629c3a6fe25514f92dd008bd34d0784dd
|
Subproject commit c1be1fe2320eed167e808eecf3e582c87b688cde
|
Loading…
Reference in New Issue
Block a user