src.dualinventive.com/fw/libdi_fw-tests/common/cmake/modules_fw/FindChibiOS.cmake

25 lines
829 B
CMake

IF(NOT CHIBIOS_ROOT)
SET(CHIBIOS_ROOT ${PROJECT_SOURCE_DIR}/ChibiOS)
ENDIF()
MESSAGE(STATUS "Chibios version:" ${ChibiOS_FIND_VERSION_MAJOR})
IF(ChibiOS_FIND_VERSION_MAJOR EQUAL 2)
MESSAGE(FATAL_ERROR "ChibiOS v2.x.x is not supported. Use older version of stm32-cmake")
ELSEIF((ChibiOS_FIND_VERSION_MAJOR EQUAL 16))
INCLUDE(ChibiOS16)
ELSEIF((NOT ChibiOS_FIND_VERSION_MAJOR) OR (ChibiOS_FIND_VERSION_MAJOR EQUAL 3))
INCLUDE(ChibiOS3)
ENDIF()
set(ChibiOS_NAME "ChibiOS")
LIST(REMOVE_DUPLICATES ChibiOS_INCLUDE_DIRS)
LIST(REMOVE_DUPLICATES ChibiOS_SOURCES)
set_source_files_properties(${ChibiOS_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-conversion")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ChibiOS DEFAULT_MSG ChibiOS_NAME ChibiOS_SOURCES ChibiOS_INCLUDE_DIRS ChibiOS_LINKER_SCRIPT)