]> git.donarmstrong.com Git - kiibohd-controller.git/blob - CMakeLists.txt
Ensure directories can only be made with printable characters
[kiibohd-controller.git] / CMakeLists.txt
1 ###| CMAKE Kiibohd Controller |###
2 #
3 # Jacob Alexander 2011-2015
4 # Due to this file's usefulness:
5 #
6 # Released into the Public Domain
7 #
8 ###
9
10
11
12 ###
13 # Chip Selection
14 #
15
16 #| You _MUST_ set this to match the microcontroller you are trying to compile for
17 #| You _MUST_ clean the build directory if you change this value
18 #|
19 set( CHIP
20 #       "at90usb162"       # Teensy   1.0 (avr)
21 #       "atmega32u4"       # Teensy   2.0 (avr)
22 #       "at90usb646"       # Teensy++ 1.0 (avr)
23 #       "at90usb1286"      # Teensy++ 2.0 (avr)
24 #       "mk20dx128"        # Teensy   3.0 (arm)
25         "mk20dx128vlf5"    # McHCK       mk20dx128vlf5
26 #       "mk20dx256"        # Teensy   3.1,3.2 (arm)
27 #       "mk20dx256vlh7"    # Kiibohd-dfu mk20dx256vlh7
28         CACHE STRING "Microcontroller Chip" )
29
30
31
32 ###
33 # Compiler Selection
34 #
35
36 #| *** EXPERIMENTAL ***
37 #| Stick with gcc unless you know what you're doing
38 #| Currently only arm is supported with clang
39 set( COMPILER
40         "gcc"   # arm-none-eabi-gcc / avr-gcc - Default
41 #       "clang" # arm-none-eabi
42         CACHE STRING "Compiler Type" )
43
44
45
46 ###
47 # Compiler Intialization
48 #
49 set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/Lib/CMake )
50 include( initialize )
51
52
53
54 ###
55 # Project Modules
56 #
57
58 #| Note: This is the only section you probably want to modify
59 #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
60 #| All of the modules must be specified, as they generate the sources list of files to compile
61 #| Any modifications to this file will cause a complete rebuild of the project
62
63 #| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
64
65 ##| Deals with acquiring the keypress information and turning it into a key index
66 set(   ScanModule "MD1"
67         CACHE STRING "Scan Module" )
68
69 ##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
70 set(  MacroModule "PartialMap"
71         CACHE STRING "Macro Module" )
72
73 ##| Sends the current list of usb key codes through USB HID
74 set( OutputModule "pjrcUSB"
75         CACHE STRING "Output Module" )
76
77 ##| Debugging source to use, each module has it's own set of defines that it sets
78 set(  DebugModule "full"
79         CACHE STRING "Debug Module" )
80
81
82
83 ###
84 # Keymap Configuration (do not include the .kll extension)
85 #
86
87 #| Do not include the .kll extension
88 #| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts
89 #| * DefaultMap allows the default keymap to be modified from the BaseMap
90 #| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...)
91 #| BaseMap generally does not need to be changed from "defaultMap"
92 #|
93 #| Syntax:
94 #|  myMap
95 #|    * defines a single .kll layout file, double-quotes are needed to distinguish between layers
96 #|  "myMap specialLayer"
97 #|    * defines myMap to be the main layout, then replace specialLayers on top of it
98 #|
99 #| - Only for PartialMaps -
100 #|  "myMap specialLayer" "myMap colemak" dvorak
101 #|    * As before, but also generates a second layer at index 2 and third at index 3
102 #|
103 #| NOTE:  Remember to add key(s) to enable each Partial Layer
104 #| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping)
105 #| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory)
106
107 ##| Set the base keyboard .kll map, defaults to "defaultMap" if not found
108 ##| Looks in Scan/<Module Name> for the available BaseMaps
109 set(     BaseMap "defaultMap"
110         CACHE STRING "KLL BaseMap/Scancode Keymapping" )
111
112 ##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth
113 ##| Can be set to ""
114 set(  DefaultMap "md1Overlay stdFuncMap"
115         CACHE STRING "KLL DefaultMap" )
116
117 ##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering
118 ##| Can be set to ""
119 set( PartialMaps "hhkbpro2"
120         CACHE STRING "KLL PartialMaps/Layer Definitions" )
121
122
123
124 ###
125 # Source Defines (in addition to the selected Modules)
126 #
127 set( MAIN_SRCS
128         main.c
129 )
130
131
132
133 ###
134 # Project Description
135 #
136
137 #| Project
138 project( kiibohd_controller )
139
140 #| Target Name (output name)
141 set( TARGET kiibohd )
142
143 #| General Settings
144 cmake_minimum_required( VERSION 2.8 )
145
146
147
148 ###
149 # Module Initialization / Compilation / Targets
150 #
151 include( modules )
152 include( kll ) # Generate kll layouts if necessary
153 include( build )
154