From f90851897c1a6e57f04b9877dd9950af2c79e10b Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 6 Apr 2023 12:03:01 -0400 Subject: [PATCH] Fix #149, update cmake recipe Prefer target-scope properties over directory scope where applicable --- CMakeLists.txt | 25 +++++++++++++++---------- fsw/tables/to_lab_sub.c | 5 ++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 803ee01..023e438 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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( + $ + $ +) -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 +) diff --git a/fsw/tables/to_lab_sub.c b/fsw/tables/to_lab_sub.c index 9bd8c01..9aee964 100644 --- a/fsw/tables/to_lab_sub.c +++ b/fsw/tables/to_lab_sub.c @@ -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 @@ -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)