fsfw-example-stm32h7-rtems/cmake/PreProjectConfig.cmake

44 lines
1.2 KiB
CMake
Raw Normal View History

2021-07-16 11:16:43 +02:00
set(RTEMS_CONFIG_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/rtems-cmake"
CACHE FILEPATH
"Directory containing the RTEMS *.cmake files"
)
include(${RTEMS_CONFIG_DIR}/RTEMSPreProjectConfig.cmake)
if(NOT DEFINED RTEMS_PREFIX)
if(NOT DEFINED ENV{RTEMS_PREFIX})
message(FATAL_ERROR
"RTEMS_PREFIX must be set either manually or as an environment "
"variable!"
)
else()
message(STATUS
"Using environment variable RTEMS_PREFIX $ENV{RTEMS_PREFIX} "
"as RTEMS prefix"
)
set(RTEMS_PREFIX $ENV{RTEMS_PREFIX})
endif()
endif()
2021-07-16 12:22:35 +02:00
if(TGT_BSP MATCHES "arm/stm32h743zi-nucleo")
2021-07-16 11:16:43 +02:00
set(RTEMS_BSP "arm/nucleo-h743zi")
else()
if(NOT DEFINED RTEMS_BSP)
if(NOT DEFINED ENV{RTEMS_BSP})
message(FATAL_ERROR
2021-07-16 12:22:35 +02:00
"RTEMS_BSP must be set either manually or as an environment variable!"
2021-07-16 11:16:43 +02:00
)
else()
set(RTEMS_BSP $ENV{RTEMS_BSP})
endif()
endif()
endif()
rtems_pre_project_config(${RTEMS_PREFIX} ${RTEMS_BSP})
2021-07-16 12:22:35 +02:00
set(CMAKE_TOOLCHAIN_FILE ${RTEMS_CONFIG_DIR}/RTEMSToolchain.cmake)
2021-07-16 11:23:42 +02:00
set(RTEMS_BSP ${RTEMS_BSP} CACHE STRING "RTEMS BSP")
set(RTEMS_PREFIX ${RTEMS_PREFIX} CACHE STRING "RTEMS Prefix")