From 3af2bb5a3bb0b89f08fdd34a67d4de023a6086a5 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 1 Jul 2020 13:26:44 -0400 Subject: [PATCH] Fix #711, Added interface and more work on UT --- fsw/cfe-core/src/msg/CMakeLists.txt | 11 +++++++++-- fsw/cfe-core/unit-test/CMakeLists.txt | 11 ++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fsw/cfe-core/src/msg/CMakeLists.txt b/fsw/cfe-core/src/msg/CMakeLists.txt index a35fa9c17..82a781047 100644 --- a/fsw/cfe-core/src/msg/CMakeLists.txt +++ b/fsw/cfe-core/src/msg/CMakeLists.txt @@ -34,8 +34,15 @@ else (MISSION_INCLUDE_CCSDSEXT_HEADER) src/cfe_msg_initdefaulthdr_v1.c) endif (MISSION_INCLUDE_CCSDSEXT_HEADER) +# Interface library (link to get public includes) +add_library(${MODULE_NAME}_interface INTERFACE) +target_include_directories(${MODULE_NAME}_interface INTERFACE inc_public) + +# Module library add_library(${MODULE_NAME} STATIC ${MODULE_SRCS}) -# Add to includes for header dependency resolution across modules -target_include_directories(${MODULE_NAME} PUBLIC inc_public) +# Link to get public includes +target_link_libraries(${MODULE_NAME} ${MODULE_NAME}_interface) + +# Add private include target_include_directories(${MODULE_NAME} PRIVATE inc_private) diff --git a/fsw/cfe-core/unit-test/CMakeLists.txt b/fsw/cfe-core/unit-test/CMakeLists.txt index 686f23bf8..ba8b3c8fa 100644 --- a/fsw/cfe-core/unit-test/CMakeLists.txt +++ b/fsw/cfe-core/unit-test/CMakeLists.txt @@ -22,10 +22,10 @@ include_directories( ) # Also include the core module public includes for now TODO cleanup -#foreach(MODULE ${MISSION_CORE_MODULES}) -# get_filename_component(MODULE_NAME ${MODULE} NAME) -# include_directories($) -#endforeach(MODULE ${MISSION_CORE_MODULES}) +foreach(MODULE ${MISSION_CORE_MODULES}) + get_filename_component(MODULE_NAME ${MODULE} NAME) + include_directories($) +endforeach(MODULE ${MISSION_CORE_MODULES}) # CFE needs a supplemental test support hook library add_library(ut_cfe-core_support STATIC @@ -73,7 +73,8 @@ foreach(MODULE ${CFE_CORE_MODULES}) ut_cfe-core_support ut_cfe-core_stubs ut_assert - mission_msg) #TODO short term... will stub out eventually +# mission_msg) #TODO short term... will stub out eventually + msg) add_test(${UT_TARGET_NAME}_UT ${UT_TARGET_NAME}_UT) install(TARGETS ${UT_TARGET_NAME}_UT DESTINATION ${TGTNAME}/${UT_INSTALL_SUBDIR})