|
|
|
@@ -1,4 +1,5 @@
|
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
project(${LIB_FSFW_NAME})
|
|
|
|
|
|
|
|
|
|
set(FSFW_VERSION_IF_GIT_FAILS 4)
|
|
|
|
|
set(FSFW_SUBVERSION_IF_GIT_FAILS 0)
|
|
|
|
@@ -60,7 +61,6 @@ set(LIB_FSFW_NAME fsfw)
|
|
|
|
|
set(FSFW_TEST_TGT fsfw-tests)
|
|
|
|
|
set(FSFW_DUMMY_TGT fsfw-dummy)
|
|
|
|
|
|
|
|
|
|
project(${LIB_FSFW_NAME})
|
|
|
|
|
add_library(${LIB_FSFW_NAME})
|
|
|
|
|
|
|
|
|
|
set(FSFW_GIT_VER_HANDLING_OK FALSE)
|
|
|
|
@@ -98,7 +98,7 @@ endif()
|
|
|
|
|
if(FSFW_BUILD_UNITTESTS)
|
|
|
|
|
message(STATUS "${MSG_PREFIX} Building the FSFW unittests in addition to the static library")
|
|
|
|
|
# Check whether the user has already installed Catch2 first
|
|
|
|
|
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION})
|
|
|
|
|
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")
|
|
|
|
@@ -132,31 +132,26 @@ if(FSFW_BUILD_UNITTESTS)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
message(STATUS "Finding and/or providing ETL library with version ${FSFW_ETL_LIB_MAJOR_VERSION}")
|
|
|
|
|
message(STATUS "Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}")
|
|
|
|
|
|
|
|
|
|
# Check whether the user has already installed ETL first
|
|
|
|
|
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
|
|
|
|
|
# find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
|
|
|
|
|
# Not installed, so use FetchContent to download and provide etl
|
|
|
|
|
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
|
|
|
|
message(STATUS
|
|
|
|
|
"No ETL installation was found with find_package. Installing and providing "
|
|
|
|
|
"etl with FindPackage"
|
|
|
|
|
)
|
|
|
|
|
include(FetchContent)
|
|
|
|
|
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
|
${FSFW_ETL_LIB_NAME}
|
|
|
|
|
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
|
|
|
|
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
FetchContent_MakeAvailable(etl)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
export(EXPORT etl
|
|
|
|
|
FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/etl.cmake"
|
|
|
|
|
NAMESPACE fsfw::
|
|
|
|
|
# if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
|
|
|
|
|
message(STATUS
|
|
|
|
|
"No etl installation was found with find_package. Installing and providing "
|
|
|
|
|
"etl with FetchContent"
|
|
|
|
|
)
|
|
|
|
|
include(FetchContent)
|
|
|
|
|
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
|
${FSFW_ETL_LIB_NAME}
|
|
|
|
|
GIT_REPOSITORY https://github.com/ETLCPP/etl
|
|
|
|
|
GIT_TAG ${FSFW_ETL_LIB_VERSION}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
FetchContent_MakeAvailable(${FSFW_ETL_LIB_NAME})
|
|
|
|
|
# endif()
|
|
|
|
|
|
|
|
|
|
set(FSFW_CORE_INC_PATH "inc")
|
|
|
|
|
|
|
|
|
@@ -419,7 +414,7 @@ target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
|
|
|
|
|
${FSFW_ETL_LIB_NAME}
|
|
|
|
|
etl
|
|
|
|
|
${FSFW_ADDITIONAL_LINK_LIBS}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|