diff --git a/CMakeLists.txt b/CMakeLists.txt index 8308f523..59acb05c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,25 @@ if(FSFW_BUILD_TESTS) configure_file(unittests/testcfg/FSFWConfig.h.in FSFWConfig.h) configure_file(unittests/testcfg/TestsConfig.h.in tests/TestsConfig.h) + if(FSFW_OSAL MATCHES "freertos") + message( + STATUS + "${MSG_PREFIX} Downloading FreeRTOS with FetchContent" + ) + include(FetchContent) + + FetchContent_Declare( + FreeRTOS + GIT_REPOSITORY https://egit.irs.uni-stuttgart.de/fsfw/FreeRTOS-LTS + GIT_TAG develop + GIT_SUBMODULES FreeRTOS/FreeRTOS-Kernel) + + list(APPEND FSFW_FETCH_CONTENT_TARGETS FreeRTOS) + + set(LIB_OS_NAME FreeRTOS) + target_include_directories(FreeRTOS PRIVATE unittests/FreeRTOS-Config) + endif() + project(${FSFW_TEST_TGT} CXX C) add_executable(${FSFW_TEST_TGT}) if(IPO_SUPPORTED AND FSFW_ENABLE_IPO) @@ -226,6 +245,9 @@ if(FSFW_FETCH_CONTENT_TARGETS) # GitHub issue: https://github.com/catchorg/Catch2/issues/2417 set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") endif() + + + endif() set(FSFW_CORE_INC_PATH "inc") diff --git a/unittests/FreeRTOS-Config/FreeRTOSConfig.h b/unittests/FreeRTOS-Config/FreeRTOSConfig.h new file mode 100644 index 00000000..e69de29b