Merge pull request 'CMake Init' (#298) from mueller/cmake-init into development

Reviewed-on: fsfw/fsfw#298
This commit is contained in:
Steffen Gaisser 2020-12-10 17:23:21 +01:00
commit 60ee66ec36
43 changed files with 439 additions and 0 deletions

85
CMakeLists.txt Normal file
View 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
View 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
View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
SharedRingBuffer.cpp
SimpleRingBuffer.cpp
)

View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ControllerBase.cpp
)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CoordinateTransformations.cpp
Sgp4Propagator.cpp
)

View 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
View 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
)

View 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}
)

View 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
View File

@ -0,0 +1,8 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Event.cpp
EventManager.cpp
EventMessage.cpp
)
add_subdirectory(eventmatching)

View 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
View File

@ -0,0 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
EventCorrelation.cpp
FailureIsolationBase.cpp
FaultCounter.cpp
)

View 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)

View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
QuaternionOperations.cpp
)

6
health/CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
HealthHelper.cpp
HealthMessage.cpp
HealthTable.cpp
)

View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
InternalErrorReporter.cpp
)

6
ipc/CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CommandMessage.cpp
CommandMessageCleaner.cpp
MessageQueueMessage.cpp
)

5
memory/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
MemoryHelper.cpp
MemoryMessage.cpp
)

5
modes/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ModeHelper.cpp
ModeMessage.cpp
)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
LimitViolationReporter.cpp
MonitoringMessage.cpp
)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ObjectManager.cpp
SystemObject.cpp
)

34
osal/CMakeLists.txt Normal file
View 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
View 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
View 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
)

View 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
)

View File

@ -0,0 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ParameterHelper.cpp
ParameterMessage.cpp
ParameterWrapper.cpp
)

7
power/CMakeLists.txt Normal file
View 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
View 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
View File

@ -0,0 +1,7 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
RMAP.cpp
RMAPCookie.cpp
RmapDeviceCommunicationIF.cpp
)

4
serialize/CMakeLists.txt Normal file
View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
SerialBufferAdapter.cpp
)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ServiceInterfaceStream.cpp
ServiceInterfaceBuffer.cpp
)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ConstStorageAccessor.cpp
StorageAccessor.cpp
)

7
subsystem/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Subsystem.cpp
SubsystemBase.cpp
)
add_subdirectory(modes)

View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ModeSequenceMessage.cpp
ModeStore.cpp
)

5
tasks/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
FixedSequenceSlot.cpp
FixedSlotSequence.cpp
)

View 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
View 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
)

View 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
View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
TmStoreMessage.cpp
)

View File

@ -0,0 +1,8 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
SpacePacket.cpp
SpacePacketBase.cpp
)
add_subdirectory(packetmatcher)
add_subdirectory(pus)

View File

@ -0,0 +1,4 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
PacketMatchTree.cpp
)

View File

@ -0,0 +1,8 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
TcPacketBase.cpp
TcPacketStored.cpp
TmPacketBase.cpp
TmPacketMinimal.cpp
TmPacketStored.cpp
)

View File

@ -0,0 +1,9 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CommandingServiceBase.cpp
PusServiceBase.cpp
PusVerificationReport.cpp
TmTcBridge.cpp
TmTcMessage.cpp
VerificationReporter.cpp
)