correct interface and private includes

This commit is contained in:
Robin Müller 2020-12-19 02:29:22 +01:00
parent c0099481a1
commit e030d7ed97
2 changed files with 34 additions and 5 deletions

View File

@ -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}
)

View File

@ -11,8 +11,19 @@ target_sources(${LIB_FSFW_NAME}
MutexFactory.cpp
PeriodicTask.cpp
QueueFactory.cpp
QueueMapManager.cpp
SemaphoreFactory.cpp
TaskFactory.cpp
Timekeeper.cpp
)
)
# 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})