diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cb4b28e..a3ca3e0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,8 +95,26 @@ if(NOT FSFW_CONFIG_PATH) add_subdirectory(defaultcfg/fsfwconfig) endif() +# FSFW might be part of a possibly complicated folder structure, so we +# extract the absolute path of the fsfwconfig folder. +if(IS_ABSOLUTE ${FSFW_CONFIG_PATH}) + set(${FSFW_CONFIG_PATH_ABSOLUTE} ${FSFW_CONFIG_PATH}) +else() + get_filename_component(${FSFW_CONFIG_PATH_ABSOLUTE} + ${FSFW_CONFIG_PATH} ABSOLUTE + ) +endif() + # Required include paths to compile the FSFW -target_include_directories(${LIB_FSFW_NAME} - INTERFACE - ${FSFW_CONFIG_PATH} +target_include_directories(${LIB_FSFW_NAME} INTERFACE + ${CMAKE_SOURCE_DIR} + ${FSFW_CONFIG_PATH_ABSOLUTE} +) + +# Includes path required to compile FSFW itself as well +# We assume that the fsfwconfig folder uses include relative to the project +# root here! +target_include_directories(${LIB_FSFW_NAME} PRIVATE + ${CMAKE_SOURCE_DIR} + ${FSFW_CONFIG_PATH_ABSOLUTE} ) diff --git a/osal/FreeRTOS/CMakeLists.txt b/osal/FreeRTOS/CMakeLists.txt index a7b1338f..c310c5cf 100644 --- a/osal/FreeRTOS/CMakeLists.txt +++ b/osal/FreeRTOS/CMakeLists.txt @@ -11,8 +11,19 @@ target_sources(${LIB_FSFW_NAME} MutexFactory.cpp PeriodicTask.cpp QueueFactory.cpp - QueueMapManager.cpp SemaphoreFactory.cpp TaskFactory.cpp Timekeeper.cpp -) \ No newline at end of file +) + +# FreeRTOS is required to link the FSFW now. It is recommended to compile +# FreeRTOS as a static library and set LIB_OS_NAME to the target name of the +# library. +if(NOT LIB_OS_NAME) + message(FATAL_ERROR + "FreeRTOS needs to be linked as a target and " + "LIB_OS_NAME needs to be set to the target" + ) +endif() + +target_link_libraries(${LIB_FSWFW_NAME} ${LIB_OS_NAME}) \ No newline at end of file