]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Lib/CMake/initialize.cmake
Reorganizing CMake build system.
[kiibohd-controller.git] / Lib / CMake / initialize.cmake
1 ###| CMAKE Kiibohd Controller Initialization |###
2 #
3 # Written by Jacob Alexander in 2011-2014 for the Kiibohd Controller
4 #
5 # Released into the Public Domain
6 #
7 ###
8
9
10 #| Windows / Cygwin Compatibility options
11 set( CMAKE_LEGACY_CYGWIN_WIN32 0 )
12 set( CMAKE_USE_RELATIVE_PATHS  1 )
13
14
15
16 ###
17 # Compiler Lookup
18 #
19
20 #| avr match
21 if ( "${CHIP}" MATCHES "^at90usb.*$" OR "${CHIP}" MATCHES "^atmega.*$" )
22         set( COMPILER_FAMILY "avr" )
23
24 #| arm match
25 elseif ( "${CHIP}" MATCHES "^mk20dx.*$" )
26         set( COMPILER_FAMILY "arm" )
27
28 #| Invalid CHIP
29 else ()
30         message( FATAL_ERROR "CHIP: ${CHIP} - Unknown chip, could not choose compiler..." )
31 endif ()
32
33 #| Results of Compiler Lookup
34 message( STATUS "Compiler Family:" )
35 message( "${COMPILER_FAMILY}" )
36
37 #| Load the compiler family specific configurations
38 include( Lib/CMake/${COMPILER_FAMILY}.cmake )
39
40 #| Binutils not set by CMake
41 set( CMAKE_SIZE "${_CMAKE_TOOLCHAIN_PREFIX}size" )
42