44 lines
1.2 KiB
CMake
44 lines
1.2 KiB
CMake
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()
|
|
|
|
if(TGT_BSP MATCHES "arm/stm32h743zi-nucleo")
|
|
set(RTEMS_BSP "arm/nucleo-h743zi")
|
|
else()
|
|
if(NOT DEFINED RTEMS_BSP)
|
|
if(NOT DEFINED ENV{RTEMS_BSP})
|
|
message(FATAL_ERROR
|
|
"RTEMS_BSP must be set either manually or as an environment variable!"
|
|
)
|
|
else()
|
|
set(RTEMS_BSP $ENV{RTEMS_BSP})
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
rtems_pre_project_config(${RTEMS_PREFIX} ${RTEMS_BSP})
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE ${RTEMS_CONFIG_DIR}/RTEMSToolchain.cmake)
|
|
|
|
set(RTEMS_BSP ${RTEMS_BSP} CACHE STRING "RTEMS BSP")
|
|
set(RTEMS_PREFIX ${RTEMS_PREFIX} CACHE STRING "RTEMS Prefix")
|