Mercurial > louis > kiibohd-controller
annotate Lib/CMake/kll.cmake @ 361:7c6ac7b88cda
Working support for Interconnect
- Supports up to 255 slave nodes (you'll run into ScanCode limitations before then)
- Requires most recent kll compiler update
- Additional debugging output and stats counters
- Noise and parity checking
- Fixed TxFIFO issue when sending buffers larger than the FIFO
- Cleaned up defaultMap.kll
- Added ScanCode caching (reduces interconnect traffic significantly)
- Interconnect module code is conditionally compiled into PartialMap module if required
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sat, 15 Aug 2015 21:53:59 -0700 |
parents | b4f66a698f36 |
children |
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 if ( NOT EXISTS ${pathname}/${MAP}.kll ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
62 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
63 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
64 elseif ( EXISTS "${pathname}/${MAP}.kll" ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
65 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${MAP}.kll ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
66 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${MAP}.kll ) |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
67 else () |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
68 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
|
69 endif () |
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
70 endforeach () |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
71 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
72 #| Configure DefaultMap if specified |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
73 if ( NOT "${DefaultMap}" STREQUAL "" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
74 set ( DefaultMap_Args -d ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
75 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
76 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
|
77 foreach ( MAP ${MAP_LIST} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
78 # 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
|
79 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
80 set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll ) |
323
9690998a93b9
Fixing kll depends bug in cmake.
Jacob Alexander <haata@kiibohd.com>
parents:
293
diff
changeset
|
81 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
|
82 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
|
83 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
|
84 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
|
85 else () |
359
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
86 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
|
87 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
88 endforeach () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
89 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
90 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
91 #| Configure PartialMaps if specified |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
92 if ( NOT "${PartialMaps}" STREQUAL "" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
93 # For each partial layer |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
94 foreach ( MAP ${PartialMaps} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
95 set ( PartialMap_Args ${PartialMap_Args} -p ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
96 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
97 # Combine each layer |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
98 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
|
99 foreach ( MAP_PART ${MAP_LIST} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
100 # 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 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
|
107 else () |
359
b4f66a698f36
Adding preliminary MDErgo keymap
Jacob Alexander <haata@kiibohd.com>
parents:
324
diff
changeset
|
108 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
|
109 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
110 endforeach () |
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 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
113 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
114 |
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
|
115 #| 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
|
116 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
|
117 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
|
118 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
|
119 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
|
120 |
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 |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
122 |
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 # Run KLL Compiler |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
125 # |
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 #| KLL Options |
288
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
128 set ( kll_backend --backend kiibohd ) |
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
129 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
|
130 set ( kll_outputname generatedKeymap.h kll_defs.h ) |
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
131 set ( kll_output --outputs ${kll_outputname} ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
132 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
133 #| KLL Cmd |
288
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
134 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
|
135 add_custom_command ( OUTPUT ${kll_outputname} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
136 COMMAND ${kll_cmd} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
137 DEPENDS ${KLL_DEPENDS} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
138 COMMENT "Generating KLL Layout" |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
139 ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
140 |
283
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
141 #| KLL Regen Convenience Target |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
142 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
|
143 COMMAND ${kll_cmd} |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
144 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
|
145 ) |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
146 |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
147 #| 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
|
148 set ( SRCS ${SRCS} ${kll_outputname} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
149 |
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 endif () # PartialMap |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
153 |