Skip to content

Commit

Permalink
Fix nasa#711, Added interface and more work on UT
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Aug 7, 2020
1 parent 0b4aba1 commit 3af2bb5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 9 additions & 2 deletions fsw/cfe-core/src/msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 6 additions & 5 deletions fsw/cfe-core/unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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($<TARGET_PROPERTY:${MODULE_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
#endforeach(MODULE ${MISSION_CORE_MODULES})
foreach(MODULE ${MISSION_CORE_MODULES})
get_filename_component(MODULE_NAME ${MODULE} NAME)
include_directories($<TARGET_PROPERTY:${MODULE_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
endforeach(MODULE ${MISSION_CORE_MODULES})

# CFE needs a supplemental test support hook library
add_library(ut_cfe-core_support STATIC
Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit 3af2bb5

Please sign in to comment.