Skip to content

Commit

Permalink
Fix nasa#149, update cmake recipe
Browse files Browse the repository at this point in the history
Prefer target-scope properties over directory scope where applicable
  • Loading branch information
jphickey committed Apr 7, 2023
1 parent 7ca124c commit f908518
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
25 changes: 15 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
cmake_minimum_required(VERSION 3.5)
project(CFS_TO_LAB C)

# Include source directory for table use
include_directories(fsw/src)
# These references are specifically needed for the table build
# it is easiest to add them as directory properties so they won't
# be considered include directories for TO_LAB itself.
include_directories(
$<TARGET_PROPERTY:ci_lab,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:sample_app,INTERFACE_INCLUDE_DIRECTORIES>
)

include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)
include_directories(${ci_lab_MISSION_DIR}/fsw/platform_inc)
include_directories(${sample_app_MISSION_DIR}/fsw/platform_inc)

aux_source_directory(fsw/src APP_SRC_FILES)
set(APP_SRC_FILES
fsw/src/to_lab_app.c
)

# Create the app module
add_cfe_app(to_lab ${APP_SRC_FILES})
add_cfe_tables(to_lab fsw/tables/to_lab_sub.c)

add_cfe_tables(TO_LAB_Subs fsw/tables/to_lab_sub.c)

target_include_directories(to_lab PUBLIC
fsw/mission_inc
fsw/platform_inc
)
5 changes: 2 additions & 3 deletions fsw/tables/to_lab_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "cfe_tbl_filedef.h" /* Required to obtain the CFE_TBL_FILEDEF macro definition */

#include "to_lab_sub_table.h"
#include "to_lab_app.h"

/*
** Add the proper include file for the message IDs below
Expand Down Expand Up @@ -75,7 +74,7 @@ TO_LAB_Subs_t TO_LAB_Subs = {.Subs = {/* CFS App Subscriptions */
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_APP_TLM_MID), {0, 0}, 4},
{CFE_SB_MSGID_WRAP_VALUE(CFE_ES_MEMSTATS_TLM_MID), {0, 0}, 4},

/* TO_LAB_UNUSED entry to mark the end of valid MsgIds */
{TO_LAB_UNUSED, {0, 0}, 0}}};
/* CFE_SB_MSGID_RESERVED entry to mark the end of valid MsgIds */
{CFE_SB_MSGID_RESERVED, {0, 0}, 0}}};

CFE_TBL_FILEDEF(TO_LAB_Subs, TO_LAB_APP.TO_LAB_Subs, TO Lab Sub Tbl, to_lab_sub.tbl)

0 comments on commit f908518

Please sign in to comment.