From 547c788c818069abb9eaea12a0c997376641f9aa Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Tue, 23 Mar 2021 16:13:09 +0100 Subject: [PATCH] using options now --- CMakeLists.txt | 9 +++++++-- linux/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb09957..9c1967e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.13) +option(FSFW_HAL_ADD_LINUX "Add the Linux HAL to the sources. Required gpiod library" OFF) +option(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific code to the sources" OFF) + +option(FSFW_HAL_ADD_STM32H7 "Add the STM32H7 HAL to the sources" OFF) + set(LIB_FSFW_HAL_NAME fsfw_hal) set(LINUX_HAL_PATH_NAME linux) set(STM32H7_PATH_NAME stm32h7) @@ -19,11 +24,11 @@ target_sources(${LIB_FSFW_HAL_NAME} PRIVATE Dummy.cpp ) -if(TGT_BSP MATCHES "arm/raspberrypi") +if(FSFW_HAL_ADD_LINUX) add_subdirectory(${LINUX_HAL_PATH_NAME}) endif() -if(TGT_BSP MATCHES "arm/stm32h743zi-nucleo") +if(FSFW_HAL_ADD_STM32H7) add_subdirectory(${STM32H7_PATH_NAME}) endif() diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 111568f..a2bfee1 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,4 +1,4 @@ -if(TGT_BSP MATCHES "arm/raspberrypi") +if(FSFW_HAL_ADD_RASPBERRY_PI) add_subdirectory(rpi) endif()