reverting changes to CMakeList.txt to move back topwards upstream

This commit is contained in:
Ulrich Mohr 2022-09-07 11:09:17 +02:00
parent c14b131e6f
commit 7754d65753

View File

@ -38,14 +38,12 @@ if(TGT_BSP)
OR TGT_BSP MATCHES "arm/beagleboneblack")
option(LINUX_CROSS_COMPILE ON)
endif()
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
elseif(TGT_BSP MATCHES "arm/q7s")
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
endif()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
ON)
else()
@ -54,7 +52,6 @@ else()
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Perform steps like loading toolchain files where applicable.
include(PreProjectConfig)
pre_project_config()
@ -81,10 +78,9 @@ if(EIVE_Q7S_EM)
else()
set(OBSW_Q7S_EM
0
CACHE STRING "Q7S FM configuration")
CACHE STRING "Q7S EM configuration")
set(INIT_VAL 1)
endif()
set(OBSW_ADD_MGT
${INIT_VAL}
CACHE STRING "Add MGT module")
@ -134,13 +130,11 @@ set(OBSW_ADD_RW
# Version handling
set(GIT_VER_HANDLING_OK FALSE)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
determine_version_with_git("--exclude" "docker_*")
set(GIT_INFO
${GIT_INFO}
CACHE STRING "Version information retrieved with git describe")
if(GIT_INFO)
set(GIT_INFO
${GIT_INFO}
@ -149,25 +143,20 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1)
if(NOT OBSW_VERSION_MAJOR)
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
endif()
if(NOT OBSW_VERSION_MINOR)
set(FSFW_SUBVERSION ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
endif()
if(NOT OBSW_VERSION_REVISION)
set(FSFW_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS})
endif()
set(GIT_VER_HANDLING_OK TRUE)
else()
set(GIT_VER_HANDLING_OK FALSE)
endif()
endif()
if(NOT GIT_VER_HANDLING_OK)
set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS})
set(OBSW_VERSION_MINOR ${OBSW_VERSION_MINOR_IF_GIT_FAILS})
@ -224,7 +213,6 @@ if(TGT_BSP)
# I assume a newer version than 3.17 will be installed on other Linux board
# than the Q7S
set(LIBGPS_VERSION_MINOR 20)
if(TGT_BSP MATCHES "arm/q7s"
OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack"
@ -237,8 +225,6 @@ if(TGT_BSP)
set(EIVE_ADD_LINUX_FILES TRUE)
set(ADD_CSP_LIB TRUE)
set(FSFW_HAL_ADD_LINUX ON)
set(FSFW_HAL_LINUX_ADD_LIBGPIOD ON)
set(FSFW_HAL_LINUX_ADD_PERIPHERAL_DRIVERS ON)
endif()
endif()
@ -280,7 +266,6 @@ endif()
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
configure_file(${BSP_PATH}/OBSWConfig.h.in OBSWConfig.h)
if(TGT_BSP MATCHES "arm/q7s")
configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h)
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
@ -320,13 +305,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
"-Wshift-overflow=2" # Search for bit left shift overflows (<c++14)
"-Wcast-qual" # Warn if the constness is cast away
"-Wstringop-overflow=4"
# -Wstack-protector # Emits a few false positives for low level access
# -Wconversion # Creates many false positives -Warith-conversion # Use with
# Wconversion to find more implicit conversions -fanalyzer # Should be used
# to look through problems
)
# Remove unused sections.
add_compile_options("-ffunction-sections" "-fdata-sections")
@ -365,6 +348,7 @@ else()
endif()
if(EIVE_ADD_ETL_LIB)
endif()
if(EIVE_ADD_JSON_LIB)
@ -400,7 +384,6 @@ add_subdirectory(${UNITTEST_PATH})
# This should have already been downloaded by the FSFW Still include it to be
# safe
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide etl
if(NOT etl_FOUND)
message(
@ -421,7 +404,6 @@ if(NOT(TGT_BSP MATCHES "arm/te0720-1cfa")
AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
# Check whether the user has already installed Catch2 first
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(
@ -444,11 +426,9 @@ endif()
# after their declaration
if(FSFW_FETCH_CONTENT_TARGETS)
FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS})
if(TARGET etl)
add_library(${LIB_ETL_TARGET} ALIAS etl)
endif()
if(TARGET Catch2)
# Fixes regression -preview4, to be confirmed in later releases Related
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
@ -496,8 +476,6 @@ endif()
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
# Add include paths for all sources.
message(${FSFW_CONFIG_PATH})
target_include_directories(
${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH}
${CMAKE_CURRENT_BINARY_DIR} ${LIB_ARCSEC_PATH})
@ -521,7 +499,6 @@ endif()
if(NOT CMAKE_SIZE)
set(CMAKE_SIZE size)
if(WIN32)
set(FILE_SUFFIX ".exe")
endif()