Merge pull request 'CMake Init' (#298) from mueller/cmake-init into development
Reviewed-on: fsfw/fsfw#298
This commit is contained in:
commit
60ee66ec36
85
CMakeLists.txt
Normal file
85
CMakeLists.txt
Normal file
@ -0,0 +1,85 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(LIB_FSFW_NAME fsfw)
|
||||
add_library(${LIB_FSFW_NAME})
|
||||
|
||||
# Set options for FSFW OSAL selection.
|
||||
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()
|
||||
|
||||
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos)
|
||||
|
||||
if(${OS_FSFW} STREQUAL host)
|
||||
set(OS_FSFW_NAME "Host")
|
||||
elseif(${OS_FSFW} STREQUAL linux)
|
||||
set(OS_FSFW_NAME "Linux")
|
||||
elseif(${OS_FSFW} STREQUAL freertos)
|
||||
set(OS_FSFW_NAME "FreeRTOS")
|
||||
elseif(${OS_FSFW} STREQUAL rtems)
|
||||
set(OS_FSFW_NAME "RTEMS")
|
||||
else()
|
||||
message(WARNING "Invalid operating system for FSFW specified! Setting to host..")
|
||||
set(OS_FSFW_NAME "Host")
|
||||
set(OS_FSFW "host")
|
||||
endif()
|
||||
|
||||
message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system")
|
||||
|
||||
# Options to exclude parts of the FSFW from compilation.
|
||||
option(FSFW_USE_RMAP "Compile with RMAP" ON)
|
||||
option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON)
|
||||
|
||||
add_subdirectory(action)
|
||||
add_subdirectory(container)
|
||||
add_subdirectory(controller)
|
||||
add_subdirectory(coordinates)
|
||||
add_subdirectory(datalinklayer)
|
||||
add_subdirectory(datapool)
|
||||
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)
|
||||
add_subdirectory(rmap)
|
||||
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)
|
||||
message(WARNING "Flight Software Framework configuration path not set!")
|
||||
message(WARNING "Setting default configuration!")
|
||||
add_subdirectory(defaultcfg/fsfwconfig)
|
||||
endif()
|
||||
|
||||
# Required include paths to compile the FSFW
|
||||
target_include_directories(${LIB_FSFW_NAME}
|
||||
INTERFACE
|
||||
${FSFW_CONFIG_PATH}
|
||||
)
|
7
action/CMakeLists.txt
Normal file
7
action/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ActionHelper.cpp
|
||||
ActionMessage.cpp
|
||||
CommandActionHelper.cpp
|
||||
SimpleActionHelper.cpp
|
||||
)
|
5
container/CMakeLists.txt
Normal file
5
container/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
SharedRingBuffer.cpp
|
||||
SimpleRingBuffer.cpp
|
||||
)
|
4
controller/CMakeLists.txt
Normal file
4
controller/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ControllerBase.cpp
|
||||
)
|
5
coordinates/CMakeLists.txt
Normal file
5
coordinates/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CoordinateTransformations.cpp
|
||||
Sgp4Propagator.cpp
|
||||
)
|
12
datalinklayer/CMakeLists.txt
Normal file
12
datalinklayer/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clcw.cpp
|
||||
DataLinkLayer.cpp
|
||||
Farm1StateLockout.cpp
|
||||
Farm1StateOpen.cpp
|
||||
Farm1StateWait.cpp
|
||||
MapPacketExtraction.cpp
|
||||
TcTransferFrame.cpp
|
||||
TcTransferFrameLocal.cpp
|
||||
VirtualChannelReception.cpp
|
||||
)
|
11
datapool/CMakeLists.txt
Normal file
11
datapool/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ControllerSet.cpp
|
||||
DataPool.cpp
|
||||
DataPoolAdmin.cpp
|
||||
DataPoolParameterWrapper.cpp
|
||||
DataSet.cpp
|
||||
HkSwitchHelper.cpp
|
||||
PoolEntry.cpp
|
||||
PoolRawAccess.cpp
|
||||
)
|
15
defaultcfg/fsfwconfig/CMakeLists.txt
Normal file
15
defaultcfg/fsfwconfig/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
target_sources(${TARGET_NAME}
|
||||
PRIVATE
|
||||
)
|
||||
|
||||
# Add include paths for the executable
|
||||
target_include_directories(${TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# Add include paths for the FSFW library
|
||||
target_include_directories(${LIB_FSFW_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
11
devicehandlers/CMakeLists.txt
Normal file
11
devicehandlers/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
AssemblyBase.cpp
|
||||
ChildHandlerBase.cpp
|
||||
ChildHandlerFDIR.cpp
|
||||
DeviceHandlerBase.cpp
|
||||
DeviceHandlerFailureIsolation.cpp
|
||||
DeviceHandlerMessage.cpp
|
||||
DeviceTmReportingWrapper.cpp
|
||||
HealthDevice.cpp
|
||||
)
|
8
events/CMakeLists.txt
Normal file
8
events/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Event.cpp
|
||||
EventManager.cpp
|
||||
EventMessage.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(eventmatching)
|
7
events/eventmatching/CMakeLists.txt
Normal file
7
events/eventmatching/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
EventIdRangeMatcher.cpp
|
||||
EventMatchTree.cpp
|
||||
ReporterRangeMatcher.cpp
|
||||
SeverityRangeMatcher.cpp
|
||||
)
|
6
fdir/CMakeLists.txt
Normal file
6
fdir/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
EventCorrelation.cpp
|
||||
FailureIsolationBase.cpp
|
||||
FaultCounter.cpp
|
||||
)
|
12
globalfunctions/CMakeLists.txt
Normal file
12
globalfunctions/CMakeLists.txt
Normal file
@ -0,0 +1,12 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
arrayprinter.cpp
|
||||
AsciiConverter.cpp
|
||||
CRC.cpp
|
||||
DleEncoder.cpp
|
||||
PeriodicOperationDivider.cpp
|
||||
timevalOperations.cpp
|
||||
Type.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(math)
|
4
globalfunctions/math/CMakeLists.txt
Normal file
4
globalfunctions/math/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
QuaternionOperations.cpp
|
||||
)
|
6
health/CMakeLists.txt
Normal file
6
health/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
HealthHelper.cpp
|
||||
HealthMessage.cpp
|
||||
HealthTable.cpp
|
||||
)
|
4
internalError/CMakeLists.txt
Normal file
4
internalError/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
InternalErrorReporter.cpp
|
||||
)
|
6
ipc/CMakeLists.txt
Normal file
6
ipc/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CommandMessage.cpp
|
||||
CommandMessageCleaner.cpp
|
||||
MessageQueueMessage.cpp
|
||||
)
|
5
memory/CMakeLists.txt
Normal file
5
memory/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
MemoryHelper.cpp
|
||||
MemoryMessage.cpp
|
||||
)
|
5
modes/CMakeLists.txt
Normal file
5
modes/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ModeHelper.cpp
|
||||
ModeMessage.cpp
|
||||
)
|
5
monitoring/CMakeLists.txt
Normal file
5
monitoring/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
LimitViolationReporter.cpp
|
||||
MonitoringMessage.cpp
|
||||
)
|
5
objectmanager/CMakeLists.txt
Normal file
5
objectmanager/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ObjectManager.cpp
|
||||
SystemObject.cpp
|
||||
)
|
34
osal/CMakeLists.txt
Normal file
34
osal/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
# Check the OS_FSFW variable
|
||||
if(${OS_FSFW} STREQUAL "freertos")
|
||||
add_subdirectory(FreeRTOS)
|
||||
elseif(${OS_FSFW} STREQUAL "rtems")
|
||||
add_subdirectory(rtems)
|
||||
elseif(${OS_FSFW} STREQUAL "linux")
|
||||
add_subdirectory(linux)
|
||||
elseif(${OS_FSFW} STREQUAL "host")
|
||||
add_subdirectory(host)
|
||||
if (WIN32)
|
||||
add_subdirectory(windows)
|
||||
elseif(UNIX)
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PUBLIC
|
||||
linux/TcUnixUdpPollingTask.cpp
|
||||
linux/TmTcUnixUdpBridge.cpp
|
||||
)
|
||||
endif ()
|
||||
|
||||
else()
|
||||
|
||||
message(WARNING "The OS_FSFW variable was not set. Assuming host OS..")
|
||||
# Not set. Assumuing this is a host build, try to determine host OS
|
||||
if (WIN32)
|
||||
add_subdirectory(host)
|
||||
add_subdirectory(windows)
|
||||
elseif (UNIX)
|
||||
add_subdirectory(linux)
|
||||
else ()
|
||||
# MacOS or other OSes have not been tested yet / are not supported.
|
||||
message(FATAL_ERROR "The host OS could not be determined! Aborting.")
|
||||
endif()
|
||||
|
||||
endif()
|
21
osal/host/CMakeLists.txt
Normal file
21
osal/host/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clock.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicTask.cpp
|
||||
QueueFactory.cpp
|
||||
QueueMapManager.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
add_definitions(-pthread)
|
||||
target_link_libraries(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
rt
|
||||
)
|
||||
endif()
|
25
osal/linux/CMakeLists.txt
Normal file
25
osal/linux/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clock.cpp
|
||||
BinarySemaphore.cpp
|
||||
CountingSemaphore.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
InternalErrorCodes.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicPosixTask.cpp
|
||||
PosixThread.cpp
|
||||
QueueFactory.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
TcUnixUdpPollingTask.cpp
|
||||
TmTcUnixUdpBridge.cpp
|
||||
Timer.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
rt
|
||||
pthread
|
||||
)
|
11
osal/windows/CMakeLists.txt
Normal file
11
osal/windows/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
TcWinUdpPollingTask.cpp
|
||||
TmTcWinUdpBridge.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
wsock32
|
||||
ws2_32
|
||||
)
|
6
parameters/CMakeLists.txt
Normal file
6
parameters/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ParameterHelper.cpp
|
||||
ParameterMessage.cpp
|
||||
ParameterWrapper.cpp
|
||||
)
|
7
power/CMakeLists.txt
Normal file
7
power/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Fuse.cpp
|
||||
PowerComponent.cpp
|
||||
PowerSensor.cpp
|
||||
PowerSwitcher.cpp
|
||||
)
|
11
pus/CMakeLists.txt
Normal file
11
pus/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CService200ModeCommanding.cpp
|
||||
CService201HealthCommanding.cpp
|
||||
Service17Test.cpp
|
||||
Service1TelecommandVerification.cpp
|
||||
Service2DeviceAccess.cpp
|
||||
Service5EventReporting.cpp
|
||||
Service8FunctionManagement.cpp
|
||||
Service9TimeManagement.cpp
|
||||
)
|
7
rmap/CMakeLists.txt
Normal file
7
rmap/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
RMAP.cpp
|
||||
RMAPCookie.cpp
|
||||
RmapDeviceCommunicationIF.cpp
|
||||
)
|
||||
|
4
serialize/CMakeLists.txt
Normal file
4
serialize/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
SerialBufferAdapter.cpp
|
||||
)
|
5
serviceinterface/CMakeLists.txt
Normal file
5
serviceinterface/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ServiceInterfaceStream.cpp
|
||||
ServiceInterfaceBuffer.cpp
|
||||
)
|
5
storagemanager/CMakeLists.txt
Normal file
5
storagemanager/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ConstStorageAccessor.cpp
|
||||
StorageAccessor.cpp
|
||||
)
|
7
subsystem/CMakeLists.txt
Normal file
7
subsystem/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Subsystem.cpp
|
||||
SubsystemBase.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(modes)
|
5
subsystem/modes/CMakeLists.txt
Normal file
5
subsystem/modes/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ModeSequenceMessage.cpp
|
||||
ModeStore.cpp
|
||||
)
|
5
tasks/CMakeLists.txt
Normal file
5
tasks/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
FixedSequenceSlot.cpp
|
||||
FixedSlotSequence.cpp
|
||||
)
|
7
tcdistribution/CMakeLists.txt
Normal file
7
tcdistribution/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CCSDSDistributor.cpp
|
||||
PUSDistributor.cpp
|
||||
TcDistributor.cpp
|
||||
TcPacketCheck.cpp
|
||||
)
|
10
thermal/CMakeLists.txt
Normal file
10
thermal/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
AbstractTemperatureSensor.cpp
|
||||
CoreComponent.cpp
|
||||
Heater.cpp
|
||||
RedundantHeater.cpp
|
||||
ThermalComponent.cpp
|
||||
ThermalModule.cpp
|
||||
ThermalMonitor.cpp
|
||||
)
|
8
timemanager/CMakeLists.txt
Normal file
8
timemanager/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CCSDSTime.cpp
|
||||
Countdown.cpp
|
||||
Stopwatch.cpp
|
||||
TimeMessage.cpp
|
||||
TimeStamper.cpp
|
||||
)
|
4
tmstorage/CMakeLists.txt
Normal file
4
tmstorage/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
TmStoreMessage.cpp
|
||||
)
|
8
tmtcpacket/CMakeLists.txt
Normal file
8
tmtcpacket/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
SpacePacket.cpp
|
||||
SpacePacketBase.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(packetmatcher)
|
||||
add_subdirectory(pus)
|
4
tmtcpacket/packetmatcher/CMakeLists.txt
Normal file
4
tmtcpacket/packetmatcher/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
PacketMatchTree.cpp
|
||||
)
|
8
tmtcpacket/pus/CMakeLists.txt
Normal file
8
tmtcpacket/pus/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
TcPacketBase.cpp
|
||||
TcPacketStored.cpp
|
||||
TmPacketBase.cpp
|
||||
TmPacketMinimal.cpp
|
||||
TmPacketStored.cpp
|
||||
)
|
9
tmtcservices/CMakeLists.txt
Normal file
9
tmtcservices/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CommandingServiceBase.cpp
|
||||
PusServiceBase.cpp
|
||||
PusVerificationReport.cpp
|
||||
TmTcBridge.cpp
|
||||
TmTcMessage.cpp
|
||||
VerificationReporter.cpp
|
||||
)
|
Loading…
Reference in New Issue
Block a user