updated CMakeLists.txt
- More information about FSFW build
This commit is contained in:
parent
cd6d616806
commit
dd1631a456
@ -40,6 +40,7 @@ set(FSFW_TEST_TGT fsfw-tests)
|
|||||||
add_library(${LIB_FSFW_NAME})
|
add_library(${LIB_FSFW_NAME})
|
||||||
|
|
||||||
if(FSFW_BUILD_UNITTESTS)
|
if(FSFW_BUILD_UNITTESTS)
|
||||||
|
message(STATUS "Building the FSFW unittests in addition to the static library")
|
||||||
# Check whether the user has already installed Catch2 first
|
# Check whether the user has already installed Catch2 first
|
||||||
find_package(Catch2 3)
|
find_package(Catch2 3)
|
||||||
# Not installed, so use FetchContent to download and provide Catch2
|
# Not installed, so use FetchContent to download and provide Catch2
|
||||||
@ -61,12 +62,17 @@ if(FSFW_BUILD_UNITTESTS)
|
|||||||
add_executable(${FSFW_TEST_TGT})
|
add_executable(${FSFW_TEST_TGT})
|
||||||
|
|
||||||
if(FSFW_TESTS_GEN_COV)
|
if(FSFW_TESTS_GEN_COV)
|
||||||
|
message(STATUS "Generating coverage data for the library")
|
||||||
|
message(STATUS "Targets linking against ${LIB_FSFW_NAME} "
|
||||||
|
"will be compiled with coverage data as well"
|
||||||
|
)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
cmake-modules
|
cmake-modules
|
||||||
GIT_REPOSITORY https://github.com/bilke/cmake-modules.git
|
GIT_REPOSITORY https://github.com/bilke/cmake-modules.git
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(cmake-modules)
|
FetchContent_MakeAvailable(cmake-modules)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug")
|
||||||
list(APPEND CMAKE_MODULE_PATH ${cmake-modules_SOURCE_DIR})
|
list(APPEND CMAKE_MODULE_PATH ${cmake-modules_SOURCE_DIR})
|
||||||
include(CodeCoverage)
|
include(CodeCoverage)
|
||||||
endif()
|
endif()
|
||||||
@ -190,6 +196,11 @@ if(FSFW_BUILD_UNITTESTS)
|
|||||||
-fprofile-arcs
|
-fprofile-arcs
|
||||||
-ftest-coverage
|
-ftest-coverage
|
||||||
)
|
)
|
||||||
|
# Need to specify this as an interface, otherwise there will the compile issues
|
||||||
|
target_link_options(${LIB_FSFW_NAME} INTERFACE
|
||||||
|
-fprofile-arcs
|
||||||
|
-ftest-coverage
|
||||||
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
setup_target_for_coverage_gcovr_html(
|
setup_target_for_coverage_gcovr_html(
|
||||||
@ -302,3 +313,16 @@ target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
|||||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
||||||
${FSFW_ADDITIONAL_LINK_LIBS}
|
${FSFW_ADDITIONAL_LINK_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
string(CONCAT POST_BUILD_COMMENT
|
||||||
|
"######################################################################\n"
|
||||||
|
"Building FSFW v${FSFW_VERSION}.${FSFW_SUBVERSION}.${FSFW_REVISION}, "
|
||||||
|
"Target OSAL: ${FSFW_OS_NAME}\n"
|
||||||
|
"######################################################################\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
TARGET ${LIB_FSFW_NAME}
|
||||||
|
POST_BUILD
|
||||||
|
COMMENT ${POST_BUILD_COMMENT}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user