cmakelists update

This commit is contained in:
Robin Müller 2020-12-07 12:59:09 +01:00
parent 489a2097b8
commit d93a8692e0
3 changed files with 52 additions and 1 deletions

View File

@ -3,6 +3,32 @@ 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)

View File

@ -13,9 +13,9 @@ target_sources(${LIB_FSFW_NAME}
)
if(UNIX)
add_definitions(-pthread)
target_link_libraries(${LIB_FSFW_NAME}
PRIVATE
pthread
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
)