Skip to content

Commit

Permalink
Adding checks for expected files. These files should be named with an…
Browse files Browse the repository at this point in the history
… expected format for OSAL
  • Loading branch information
kevin-f-ortega committed Jan 7, 2025
1 parent bf4b051 commit 55ccba9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Os/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ endfunction()
function(add_fprime_supplied_os_module NAMES SUFFIX)
# Get first element of list
list(GET NAMES 0 FIRST_ITEM)

# Ensure expected files with expected filenames exist
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/Default${FIRST_ITEM}.cpp")
message(FATAL_ERROR "${CMAKE_CURRENT_LIST_DIR}/Default${FIRST_ITEM}.cpp does not exist.")
endif()

foreach (NAME IN LISTS NAMES)
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/${NAME}.cpp")
message(FATAL_ERROR "${CMAKE_CURRENT_LIST_DIR}/${NAME}.cpp does not exist.")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/${NAME}.hpp")
message(FATAL_ERROR "${CMAKE_CURRENT_LIST_DIR}/${NAME}.hpp does not exist.")
endif()
endforeach()

# Setup variables
set(OS_MODULE_NAME "Os_${FIRST_ITEM}_${SUFFIX}")
# Clear variables
set(SOURCE_FILES)
Expand Down

0 comments on commit 55ccba9

Please sign in to comment.