# ================================================================================================ # This is the toolchain file for STM32 famliy using IAR compiler and No OS. # ================================================================================================ # This project started with CMake 2.8.2 cmake_minimum_required(VERSION 2.8) set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_PROCESSOR STM32 CACHE STRING "Target Processor") set(STM32_VARIANT STM32F103 CACHE STRING "Choose a member of STM32 Family" ) add_definitions(-DUSE_STDPERIPH_DRIVER) add_definitions(-DVECT_TAB_FLASH) add_definitions(-DSTM32F10X_MD) add_definitions(-DIAR_ARM_CM3) add_definitions(-DCOMPILE_C) # ----------------------------------------------------- # #set(LIBRARY_OUTPUT_PATH # ${PROJECT_BINARY_DIR}/bin # CACHE PATH # "Single Directory for All Libraries." #) #set(EXECUTABLE_OUTPUT_PATH # ${PROJECT_BINARY_DIR}/bin # CACHE PATH # "Single Directory for All Executables." #) set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR} CACHE PATH "Project Directory" ) # ------ Compiling -------- set(COMPILER_PATH "D:/Program Files/IAR Systems/Embedded Workbench 5.5" CACHE PATH "Compiler Path" ) set(CMAKE_C_COMPILER ${COMPILER_PATH}/arm/bin/iccarm.exe CACHE PATH "C Compiler Program" ) set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) set(CMAKE_LINKER ${COMPILER_PATH}/arm/bin/ilinkarm.exe CACHE PATH "Linker Program" ) set(CMAKE_AR ${COMPILER_PATH}/arm/bin/iarchive.exe CACHE PATH "Library Program" ) #set(DLIBS "--dlib_config ${COMPILER_PATH}/arm/inc/DLib_Config_Full.h") # !! because of spcae issue in command I deleted this option and put it in header file list set(DLIBS "") set(CMAKE_C_FLAGS_INIT "--endian=little --cpu=Cortex-M3 -e --fpu=None ${DLIBS} ") set(CMAKE_C_FLAGS_DEBUG "-lC ${PROJECT_BINARY_DIR}/List/ --no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling --debug -On" CACHE STRING "Compiler Debug Flags" ) set(CMAKE_C_FLAGS_RELEASE "--no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --no_clustering --no_scheduling -On" CACHE STRING "Compiler Release Flags" ) set(CMAKE_C_FLAGS_MINSIZEREL "-Ohz" CACHE STRING "Compiler MinSize Release Flags" ) # ------ Linking -------- set(link_file_icf "D:/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/stm32f10x_flash_knx_dynalite_appl.icf") set(CMAKE_EXE_LINKER_FLAGS "--config ${link_file_icf} --redirect _Scanf=_ScanfSmall --map ${PROJECT_NAME}.map --entry __iar_program_start " CACHE STRING "Linker Flags" ) #set(CMAKE_MAKE_PROGRAM # D:/Src/Embedded/KNX/stm32_knx_device/Nmake.exe # CACHE PATH # "Make Program" #) set(CMAKE_BUILD_TYPE "Debug;Release;MinSizeRelease" CACHE STRING "CMAKE Build Types" ) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)