-
Notifications
You must be signed in to change notification settings - Fork 270
/
CMakeLists.txt
202 lines (153 loc) · 5.4 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
###| CMAKE Kiibohd Controller |###
#
# Jacob Alexander 2011-2017
# Due to this file's usefulness:
#
# Released into the Public Domain
#
###
###
# Chip Selection
#
#| You _MUST_ set this to match the microcontroller you are trying to compile for
#| You _MUST_ clean the build directory if you change this value
#|
set( CHIP
# "atmega32u4" # Teensy 2.0 (avr) - Deprecated
# "at90usb1286" # Teensy++ 2.0 (avr) - Deprecated
# "mk20dx128" # Teensy 3.0 (arm)
"mk20dx128vlf5" # McHCK mk20dx128vlf5
# "mk20dx128vlf5" # Kiibohd-dfu mk20dx128vlh7
# "mk20dx256" # Teensy 3.1,3.2 (arm)
# "mk20dx256vlh7" # Kiibohd-dfu mk20dx256vlh7
# "mk22fx512avlh7" # Kiibohd-dfu mk22fx512avlh7
# "mk64fx512" # Teensy 3.5 (arm)
# "mk66fx1m0" # Teensy 3.6 (arm)
# "host" # System compiler test environment
# "sam4s8c" # Kira
CACHE STRING "Microcontroller Chip"
)
###
# Debug
#
# Use a JLink programmer (no bootloader required)
set( JLINK
0
CACHE STRING "Enable JLINK Programming/Debugging"
)
#| swd or jtag
set( JLINK_INTERFACE
"swd"
CACHE STRING "JLink Interface"
)
#| Speed in kHz or auto
set( JLINK_SPEED
"auto"
CACHE STRING "JLink Speed"
)
###
# Compiler Selection
#
#| gcc has been tested much more (and will likely give smaller binaries)
#| clang does work though
#| Currently only arm is supported with clang
set( COMPILER
"gcc" # arm-none-eabi-gcc / avr-gcc / host-gcc - Default
# "clang" # arm-none-eabi / host
CACHE STRING "Compiler Type"
)
###
# Compiler Intialization
#
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/Lib/CMake )
include( initialize )
###
# Project Modules
#
#| Note: This is the only section you probably want to modify
#| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
#| All of the modules must be specified, as they generate the sources list of files to compile
#| Any modifications to this file will cause a complete rebuild of the project
#| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
##| Deals with acquiring the keypress information and turning it into a key index
set( ScanModule "Infinity_60"
CACHE STRING "Scan Module" )
##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
set( MacroModule "PartialMap"
CACHE STRING "Macro Module" )
##| Sends the current list of usb key codes through USB HID
set( OutputModule "USB"
CACHE STRING "Output Module"
)
##| Debugging source to use, each module has it's own set of defines that it sets
set( DebugModule "full"
CACHE STRING "Debug Module"
)
###
# Keymap Configuration (do not include the .kll extension)
#
#| Do not include the .kll extension
#| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts
#| * DefaultMap allows the default keymap to be modified from the BaseMap
#| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...)
#| BaseMap generally does not need to be changed from "defaultMap"
#|
#| Syntax:
#| myMap
#| * defines a single .kll layout file, double-quotes are needed to distinguish between layers
#| "myMap specialLayer"
#| * defines myMap to be the main layout, then replace specialLayers on top of it
#|
#| - Only for PartialMaps -
#| "myMap specialLayer" "myMap colemak" dvorak
#| * As before, but also generates a second layer at index 2 and third at index 3
#|
#| NOTE: Remember to add key(s) to enable each Partial Layer
#| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping)
#| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory)
set( LayoutName ""
CACHE STRING "Layout Name for Keyboard, often unset. No functional purpose other than documentation."
)
##| Set the base keyboard .kll map, defaults to "defaultMap" if not found
##| Looks in Scan/<Module Name> for the available BaseMaps
set( BaseMap "defaultMap"
CACHE STRING "KLL BaseMap/Scancode Keymapping" )
##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth
##| Can be set to ""
set( DefaultMap "ic60/md1Overlay stdFuncMap"
CACHE STRING "KLL DefaultMap" )
##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering
##| Can be set to ""
set( PartialMaps "ic60/hhkbpro2"
CACHE STRING "KLL PartialMaps/Layer Definitions" )
###
# Source Defines (in addition to the selected Modules)
#
set( MAIN_SRCS
main.c
)
###
# Project Description
#
#| Project
project( kiibohd_controller C )
#| Target Name (output name)
set( TARGET kiibohd )
#| Manufacturer name
#| - This can be overridden by a Scan Module setup.cmake -
#| USB Descriptor iManufacturer string
set( MANUFACTURER "Kiibohd" )
#| Flashing Station name
#| This is a placeholder value, the flashing process will overwrite this value for you
set( FLASHING_STATION_ID "xXXx" )
#| General Settings
cmake_minimum_required( VERSION 3.0 )
#| Compiler Version (only available after project() command)
message( STATUS "Full Compiler:" )
message( "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_VERSION}" )
###
# Module Initialization / Compilation / Targets
#
include( modules )
include( kll ) # Generate kll layouts if necessary
include( build )