From 45689e1789a25b39546230ca94df21cfbf6b65d9 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 27 May 2020 16:05:47 -0400 Subject: [PATCH] Fix #718, add user-specified extra modules to build Add a new setting that can be set in targets.cmake, to enable users to add extra custom functions/modules to CFE core itself. This can be used, among other things, for future support of a modular/customizable message header structure. --- cmake/arch_build.cmake | 8 +++++++- cmake/mission_build.cmake | 2 +- cmake/target/CMakeLists.txt | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index dfe5309f1..6d6ef6da3 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -356,10 +356,16 @@ function(process_arch SYSVAR) include_directories(${MISSION_SOURCE_DIR}/cfe/fsw/cfe-core/src/inc) include_directories(${MISSION_SOURCE_DIR}/cfe/cmake/target/inc) - # propagate any OSAL interface compile definitions and include directories to this build + # propagate any dependency interface compile definitions and include directories to this build # This is set as a directory property here at the top level so it will apply to all code. # This includes MODULE libraries that do not directly/statically link with OSAL but still # should be compiled with these flags. + foreach(DEPENDENCY ${MISSION_DEPS}) + if (IS_DIRECTORY "${${DEPENDENCY}_MISSION_DIR}/inc") + include_directories("${${DEPENDENCY}_MISSION_DIR}/inc") + endif() + endforeach() + get_target_property(OSAL_COMPILE_DEFINITIONS osal INTERFACE_COMPILE_DEFINITIONS) get_target_property(OSAL_INCLUDE_DIRECTORIES osal INTERFACE_INCLUDE_DIRECTORIES) diff --git a/cmake/mission_build.cmake b/cmake/mission_build.cmake index 786d98cab..6e39a4765 100644 --- a/cmake/mission_build.cmake +++ b/cmake/mission_build.cmake @@ -127,7 +127,7 @@ function(prepare) # so this is run in a loop until the list of unfound apps is empty string(REPLACE ":" ";" CFS_APP_PATH "$ENV{CFS_APP_PATH}") list(APPEND CFS_APP_PATH "apps" "apps/CFS" "libs" "psp/fsw/modules") - set(MISSION_DEPS "cfe-core" "osal") + set(MISSION_DEPS "cfe-core" "osal" ${MISSION_CORE_MODULES}) set(APP_MISSING_COUNT 0) # Set the search path of those dependency components which are fixed diff --git a/cmake/target/CMakeLists.txt b/cmake/target/CMakeLists.txt index d7b30c6f9..903b9a45c 100644 --- a/cmake/target/CMakeLists.txt +++ b/cmake/target/CMakeLists.txt @@ -110,6 +110,7 @@ endif (TGT${TGTID}_APPLIST) # This depends on whether any special features are included or not set(CFE_LINK_WHOLE_LIBS ${CFE_CORE_TARGET} + ${MISSION_CORE_MODULES} psp-${CFE_SYSTEM_PSPNAME} osal )