fsfw/CMakeLists.txt

103 lines
2.6 KiB
CMake
Raw Normal View History

2020-12-07 01:40:10 +01:00
cmake_minimum_required(VERSION 3.13)
set(LIB_FSFW_NAME fsfw)
add_library(${LIB_FSFW_NAME})
2020-12-07 12:59:09 +01:00
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos)
2020-12-17 11:46:50 +01:00
if(NOT OS_FSFW)
message(STATUS "No OS for FSFW via OS_FSFW set. Assuming host OS")
# Assume host OS and autodetermine from OS_FSFW
if(UNIX)
set(OS_FSFW "linux"
CACHE STRING
"OS abstraction layer used in the FSFW"
)
elseif(WIN32)
set(OS_FSFW "host"
CACHE STRING "OS abstraction layer used in the FSFW"
)
endif()
2020-12-17 20:18:16 +01:00
endif()
2020-12-17 11:46:50 +01:00
2020-12-07 12:59:09 +01:00
if(${OS_FSFW} STREQUAL host)
2020-12-17 11:46:50 +01:00
set(OS_FSFW_NAME "Host")
2020-12-07 12:59:09 +01:00
elseif(${OS_FSFW} STREQUAL linux)
2020-12-17 11:46:50 +01:00
set(OS_FSFW_NAME "Linux")
2020-12-07 12:59:09 +01:00
elseif(${OS_FSFW} STREQUAL freertos)
2020-12-17 11:46:50 +01:00
set(OS_FSFW_NAME "FreeRTOS")
2020-12-07 12:59:09 +01:00
elseif(${OS_FSFW} STREQUAL rtems)
2020-12-17 11:46:50 +01:00
set(OS_FSFW_NAME "RTEMS")
2020-12-07 12:59:09 +01:00
else()
2020-12-17 11:46:50 +01:00
message(WARNING
"Invalid operating system for FSFW specified! Setting to host.."
)
set(OS_FSFW_NAME "Host")
set(OS_FSFW "host")
2020-12-07 12:59:09 +01:00
endif()
message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system")
# Options to exclude parts of the FSFW from compilation.
2020-12-07 01:40:10 +01:00
option(FSFW_USE_RMAP "Compile with RMAP" ON)
2020-12-07 02:03:42 +01:00
option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON)
2020-12-07 01:40:10 +01:00
add_subdirectory(action)
add_subdirectory(container)
add_subdirectory(controller)
add_subdirectory(coordinates)
2020-12-15 23:44:43 +01:00
if(FSFW_USE_DATALINKLAYER)
2020-12-17 11:46:50 +01:00
add_subdirectory(datalinklayer)
2020-12-15 23:44:43 +01:00
endif()
2020-12-07 01:40:10 +01:00
add_subdirectory(datapool)
2020-12-12 18:32:24 +01:00
add_subdirectory(datapoollocal)
add_subdirectory(housekeeping)
2020-12-07 01:40:10 +01:00
add_subdirectory(devicehandlers)
add_subdirectory(events)
add_subdirectory(fdir)
add_subdirectory(globalfunctions)
add_subdirectory(health)
add_subdirectory(internalError)
add_subdirectory(ipc)
add_subdirectory(memory)
add_subdirectory(modes)
add_subdirectory(monitoring)
add_subdirectory(objectmanager)
add_subdirectory(osal)
add_subdirectory(parameters)
add_subdirectory(power)
add_subdirectory(pus)
if(FSFW_USE_RMAP)
2020-12-17 11:46:50 +01:00
add_subdirectory(rmap)
2020-12-07 01:40:10 +01:00
endif()
add_subdirectory(serialize)
add_subdirectory(serviceinterface)
add_subdirectory(storagemanager)
add_subdirectory(subsystem)
add_subdirectory(tasks)
add_subdirectory(tcdistribution)
add_subdirectory(thermal)
add_subdirectory(timemanager)
add_subdirectory(tmstorage)
add_subdirectory(tmtcpacket)
add_subdirectory(tmtcservices)
# The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it.
# If this is not given, we include the default configuration and emit a warning.
if(NOT FSFW_CONFIG_PATH)
2020-12-17 11:46:50 +01:00
message(WARNING "Flight Software Framework configuration path not set!")
message(WARNING "Setting default configuration!")
add_subdirectory(defaultcfg/fsfwconfig)
2020-12-07 01:40:10 +01:00
endif()
# Required include paths to compile the FSFW
target_include_directories(${LIB_FSFW_NAME}
INTERFACE
${FSFW_CONFIG_PATH}
)