Skip to content

Commit

Permalink
Merge pull request #775 from jphickey/fix-774-empty-include-error
Browse files Browse the repository at this point in the history
Fix #774,  do not generate empty include file
  • Loading branch information
astrogeco authored Jul 15, 2020
2 parents 7b93466 + 9fc86de commit 9205e1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/global_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ function(generate_config_includefile)
# then check for and use the fallback file.
# (if specified by the caller it should always exist)
# Also produce a message on the console showing whether mission config or fallback was used
if (NOT ITEM_FOUND AND GENCONFIG_ARG_FALLBACK_FILE)
if (ITEM_FOUND)
message(STATUS "Generated ${GENCONFIG_ARG_FILE_NAME} from ${MISSION_DEFS} configuration")
elseif (GENCONFIG_ARG_FALLBACK_FILE)
file(TO_NATIVE_PATH "${GENCONFIG_ARG_FALLBACK_FILE}" SRC_NATIVE_PATH)
list(APPEND WRAPPER_FILE_CONTENT
"\n\n/* No configuration for ${GENCONFIG_ARG_FILE_NAME}, using fallback */\n"
"#include \"${GENCONFIG_ARG_FALLBACK_FILE}\"\n")
message(STATUS "Using ${GENCONFIG_ARG_FALLBACK_FILE} for ${GENCONFIG_ARG_FILE_NAME}")
else()
message(STATUS "Generated ${GENCONFIG_ARG_FILE_NAME} from ${MISSION_DEFS} configuration")
message("ERROR: No implementation for ${GENCONFIG_ARG_FILE_NAME} found")
message(FATAL_ERROR "Tested: ${CHECK_PATH_LIST}")
endif()

# Generate a header file
Expand Down

0 comments on commit 9205e1d

Please sign in to comment.