annotate Lib/CMake/kll.cmake @ 359:b4f66a698f36

Adding preliminary MDErgo keymap - Required updates to CMake in order to handle the multi-layer BaseMaps
author Jacob Alexander <haata@kiibohd.com>
date Thu, 06 Aug 2015 00:36:37 -0700
parents 4bcea20b9cea
children 7c6ac7b88cda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
1 ###| CMAKE Kiibohd Controller KLL Configurator |###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
2 #
293
57f40871c726 Adding configurable DebounceDivThreshold
Jacob Alexander <haata@kiibohd.com>
parents: 288
diff changeset
3 # Written by Jacob Alexander in 2014-2015 for the Kiibohd Controller
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
4 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
5 # Released into the Public Domain
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
6 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
7 ###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
8
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
9
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
10 ###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
11 # Check if KLL compiler is needed
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
12 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
13
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
14 if ( "${MacroModule}" STREQUAL "PartialMap" )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
15
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
16
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
17
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
18 ###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
19 # KLL Installation (Make sure repo has been cloned)
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
20 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
21
273
07060ac3c813 Disabling automatic refresh of kll repo unless specifically enabled
Jacob Alexander <haata@kiibohd.com>
parents: 260
diff changeset
22 if ( NOT EXISTS "${PROJECT_SOURCE_DIR}/kll/kll.py" )
07060ac3c813 Disabling automatic refresh of kll repo unless specifically enabled
Jacob Alexander <haata@kiibohd.com>
parents: 260
diff changeset
23 message ( STATUS "Downloading latest kll version:" )
260
5dbe3bf2dc42 Adding more CMake log information.
Jacob Alexander <haata@kiibohd.com>
parents: 255
diff changeset
24
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
25 # Make sure git is available
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
26 find_package ( Git REQUIRED )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
27
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
28 # Clone kll git repo
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
29 execute_process ( COMMAND ${GIT_EXECUTABLE} clone https://github.com/kiibohd/kll.git
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
30 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31 )
273
07060ac3c813 Disabling automatic refresh of kll repo unless specifically enabled
Jacob Alexander <haata@kiibohd.com>
parents: 260
diff changeset
32 elseif ( REFRESH_KLL ) # Otherwise attempt to update the repo
07060ac3c813 Disabling automatic refresh of kll repo unless specifically enabled
Jacob Alexander <haata@kiibohd.com>
parents: 260
diff changeset
33 message ( STATUS "Checking for latest kll version:" )
07060ac3c813 Disabling automatic refresh of kll repo unless specifically enabled
Jacob Alexander <haata@kiibohd.com>
parents: 260
diff changeset
34
206
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
35 # Clone kll git repo
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
36 execute_process ( COMMAND ${GIT_EXECUTABLE} pull --rebase
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
37 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/kll
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
38 )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
39 endif () # kll/kll.py exists
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
40
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
41
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
42
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
43 ###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
44 # Prepare KLL layout arguments
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
45 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
46
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
47 #| KLL_DEPENDS is used to build a dependency tree for kll.py, this way when files are changed, kll.py gets re-run
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
48
293
57f40871c726 Adding configurable DebounceDivThreshold
Jacob Alexander <haata@kiibohd.com>
parents: 288
diff changeset
49 #| Add each of the detected capabilities.kll
57f40871c726 Adding configurable DebounceDivThreshold
Jacob Alexander <haata@kiibohd.com>
parents: 288
diff changeset
50 foreach ( filename ${ScanModule_KLL} ${MacroModule_KLL} ${OutputModule_KLL} ${DebugModule_KLL} )
57f40871c726 Adding configurable DebounceDivThreshold
Jacob Alexander <haata@kiibohd.com>
parents: 288
diff changeset
51 set ( BaseMap_Args ${BaseMap_Args} ${filename} )
57f40871c726 Adding configurable DebounceDivThreshold
Jacob Alexander <haata@kiibohd.com>
parents: 288
diff changeset
52 set ( KLL_DEPENDS ${KLL_DEPENDS} ${filename} )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
53 endforeach ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
54
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
55 #| If set BaseMap cannot be found, use default map
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
56 set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" )
359
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
57
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
58 string ( REPLACE " " ";" MAP_LIST ${BaseMap} ) # Change spaces to semicolons
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
59 foreach ( MAP ${MAP_LIST} )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
60 # Only check the Scan Module for BaseMap .kll files, default to defaultMap.kll
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
61 message("THIS -> ${pathname} ${MAP}")
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
62 if ( NOT EXISTS ${pathname}/${MAP}.kll )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
63 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
64 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
65 elseif ( EXISTS "${pathname}/${MAP}.kll" )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
66 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${MAP}.kll )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
67 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${MAP}.kll )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
68 else ()
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
69 message ( FATAL " Could not find '${MAP}.kll' BaseMap in Scan module directory" )
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
70 endif ()
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
71 endforeach ()
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
72
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
73 #| Configure DefaultMap if specified
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
74 if ( NOT "${DefaultMap}" STREQUAL "" )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
75 set ( DefaultMap_Args -d )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
76
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
77 string ( REPLACE " " ";" MAP_LIST ${DefaultMap} ) # Change spaces to semicolons
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
78 foreach ( MAP ${MAP_LIST} )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
79 # Check if kll file is in build directory, otherwise default to layout directory
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
80 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
81 set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
323
9690998a93b9 Fixing kll depends bug in cmake.
Jacob Alexander <haata@kiibohd.com>
parents: 293
diff changeset
82 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll )
324
4bcea20b9cea Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents: 323
diff changeset
83 elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll" )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
84 set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
85 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
324
4bcea20b9cea Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents: 323
diff changeset
86 else ()
359
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
87 message ( FATAL " Could not find '${MAP}.kll' DefaultMap" )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
88 endif ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
89 endforeach ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
90 endif ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
91
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
92 #| Configure PartialMaps if specified
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
93 if ( NOT "${PartialMaps}" STREQUAL "" )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
94 # For each partial layer
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
95 foreach ( MAP ${PartialMaps} )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
96 set ( PartialMap_Args ${PartialMap_Args} -p )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
97
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
98 # Combine each layer
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
99 string ( REPLACE " " ";" MAP_LIST ${MAP} ) # Change spaces to semicolons
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
100 foreach ( MAP_PART ${MAP_LIST} )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
101 # Check if kll file is in build directory, otherwise default to layout directory
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
102 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
103 set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
323
9690998a93b9 Fixing kll depends bug in cmake.
Jacob Alexander <haata@kiibohd.com>
parents: 293
diff changeset
104 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )
324
4bcea20b9cea Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents: 323
diff changeset
105 elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll" )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
106 set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
107 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
324
4bcea20b9cea Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents: 323
diff changeset
108 else ()
359
b4f66a698f36 Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents: 324
diff changeset
109 message ( FATAL " Could not find '${MAP_PART}.kll' PartialMap" )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
110 endif ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
111 endforeach ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
112 endforeach ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
113 endif ()
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
114
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
115
206
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
116 #| Print list of layout sources used
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
117 message ( STATUS "Detected Layout Files:" )
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
118 foreach ( filename ${KLL_DEPENDS} )
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
119 message ( "${filename}" )
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
120 endforeach ()
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
121
c6a90fe8cf2f Adding git refresh command to kll.cmake and kll file listing to build process
Jacob Alexander <haata@kiibohd.com>
parents: 205
diff changeset
122
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
123
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
124 ###
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
125 # Run KLL Compiler
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
126 #
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
127
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
128 #| KLL Options
288
19842eb44de2 Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents: 283
diff changeset
129 set ( kll_backend --backend kiibohd )
19842eb44de2 Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents: 283
diff changeset
130 set ( kll_template --templates ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdKeymap.h ${PROJECT_SOURCE_DIR}/kll/templates/kiibohdDefs.h )
19842eb44de2 Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents: 283
diff changeset
131 set ( kll_outputname generatedKeymap.h kll_defs.h )
19842eb44de2 Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents: 283
diff changeset
132 set ( kll_output --outputs ${kll_outputname} )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
133
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
134 #| KLL Cmd
288
19842eb44de2 Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents: 283
diff changeset
135 set ( kll_cmd ${PROJECT_SOURCE_DIR}/kll/kll.py ${BaseMap_Args} ${DefaultMap_Args} ${PartialMap_Args} ${kll_backend} ${kll_template} ${kll_output} )
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
136 add_custom_command ( OUTPUT ${kll_outputname}
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
137 COMMAND ${kll_cmd}
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
138 DEPENDS ${KLL_DEPENDS}
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
139 COMMENT "Generating KLL Layout"
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
140 )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
141
283
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
142 #| KLL Regen Convenience Target
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
143 add_custom_target ( kll_regen
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
144 COMMAND ${kll_cmd}
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
145 COMMENT "Re-generating KLL Layout"
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
146 )
b42eb01994ef Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents: 273
diff changeset
147
205
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
148 #| Append generated file to required sources so it becomes a dependency in the main build
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
149 set ( SRCS ${SRCS} ${kll_outputname} )
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
150
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
151
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
152
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
153 endif () # PartialMap
a2e9bb170eef Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
154