CMAKE_MINIMUM_REQUIRED ( VERSION 2.6 ) PROJECT ( gcd ) ARM_SETUP_ENVIRONMENT ( ${PROJECT_NAME} ) SET ( CMAKE_VERBOSE_MAKEFILE OFF ) OPTION ( STM32F10X_LD "Using STM32F10X low density device" OFF ) OPTION ( STM32F10X_MD "Using STM32F10X medium density device" ON ) OPTION ( STM32F10X_HD "Using STM32F10X high density device" OFF ) OPTION ( STM32F10X_XL "Using STM32F10X extra density device" OFF ) OPTION ( STM32F4XX "Using STM32F4XX device" OFF ) SET ( APP_VERSION_MAJOR 1 ) SET ( APP_VERSION_MINOR 1 ) SET ( APP_VERSION_PATCH 0 ) SET ( APP_VERSION_STRING "\"${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}\"" ) CONFIGURE_FILE ( ${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h ) FILE ( WRITE ${CMAKE_SOURCE_DIR}/src/.gitignore ".gitignore\nconfig.h" ) IF ( STM32F10X_LD ) ADD_DEFINITIONS ( "-DSTM32F10X_LD -DUSE_STDPERIPH_DRIVER" ) ELSEIF ( STM32F10X_MD ) ADD_DEFINITIONS ( "-DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER" ) ELSEIF ( STM32F10X_HD ) ADD_DEFINITIONS ( "-DSTM32F10X_HD -DUSE_STDPERIPH_DRIVER" ) ELSEIF ( STM32F10X_XL ) ADD_DEFINITIONS ( "-DSTM32F10X_XL -DUSE_STDPERIPH_DRIVER" ) ELSEIF ( STM32F4XX ) ADD_DEFINITIONS ( "-DSTM32F4XX -DUSE_STDPERIPH_DRIVER -DARM_MATH_CM3 -DUSE_USB_OTG_FS" ) ELSE ( STM32F10X_HD ) MESSAGE ( FATAL_ERROR "Device not selected, set one of STM32FXXX_xx to ON" ) ENDIF ( STM32F10X_LD ) SET ( LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) SET ( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin ) SET ( ALL_LIBRARIES m ) ADD_SUBDIRECTORY ( src )