Mercurial > louis > kiibohd-controller
annotate Lib/CMake/kll.cmake @ 324:4bcea20b9cea
Adding .kll file existence checks to CMake
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sat, 09 May 2015 20:36:37 +0000 |
parents | 9690998a93b9 |
children | b4f66a698f36 |
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}" ) |
208
5805b1abb5d4
Adding support to Macro support to DPH
Jacob Alexander <haata@kiibohd.com>
parents:
206
diff
changeset
|
57 if ( NOT EXISTS ${pathname}/${BaseMap}.kll ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
58 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
59 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll ) |
324
4bcea20b9cea
Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents:
323
diff
changeset
|
60 elseif ( EXISTS "${pathname}/${BaseMap}.kll" ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
61 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
62 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll ) |
324
4bcea20b9cea
Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents:
323
diff
changeset
|
63 else () |
4bcea20b9cea
Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents:
323
diff
changeset
|
64 message ( FATAL "Could not find '${BaseMap}.kll'" ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
65 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
66 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
67 #| Configure DefaultMap if specified |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
68 if ( NOT "${DefaultMap}" STREQUAL "" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
69 set ( DefaultMap_Args -d ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
70 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
71 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
|
72 foreach ( MAP ${MAP_LIST} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
73 # 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
|
74 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
75 set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll ) |
323
9690998a93b9
Fixing kll depends bug in cmake.
Jacob Alexander <haata@kiibohd.com>
parents:
293
diff
changeset
|
76 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
|
77 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
|
78 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
|
79 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
|
80 else () |
4bcea20b9cea
Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents:
323
diff
changeset
|
81 message ( FATAL "Could not find '${MAP}.kll'" ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
82 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
83 endforeach () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
84 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
85 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
86 #| Configure PartialMaps if specified |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
87 if ( NOT "${PartialMaps}" STREQUAL "" ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
88 # For each partial layer |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
89 foreach ( MAP ${PartialMaps} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
90 set ( PartialMap_Args ${PartialMap_Args} -p ) |
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 # Combine each layer |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
93 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
|
94 foreach ( MAP_PART ${MAP_LIST} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
95 # 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
|
96 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
|
97 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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 else () |
4bcea20b9cea
Adding .kll file existence checks to CMake
Jacob Alexander <haata@kiibohd.com>
parents:
323
diff
changeset
|
103 message ( FATAL "Could not find '${MAP_PART}.kll'" ) |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
104 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
105 endforeach () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
106 endforeach () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
107 endif () |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
108 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
109 |
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
|
110 #| 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
|
111 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
|
112 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
|
113 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
|
114 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
|
115 |
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 |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
117 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
118 ### |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
119 # Run KLL Compiler |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
120 # |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
121 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
122 #| KLL Options |
288
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
123 set ( kll_backend --backend kiibohd ) |
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
124 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
|
125 set ( kll_outputname generatedKeymap.h kll_defs.h ) |
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
126 set ( kll_output --outputs ${kll_outputname} ) |
205
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 Cmd |
288
19842eb44de2
Updating kll invocation arguments for readability.
Jacob Alexander <haata@kiibohd.com>
parents:
283
diff
changeset
|
129 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
|
130 add_custom_command ( OUTPUT ${kll_outputname} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
131 COMMAND ${kll_cmd} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
132 DEPENDS ${KLL_DEPENDS} |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
133 COMMENT "Generating KLL Layout" |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
134 ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
135 |
283
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
136 #| KLL Regen Convenience Target |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
137 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
|
138 COMMAND ${kll_cmd} |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
139 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
|
140 ) |
b42eb01994ef
Adding convenience build target for testing out kll compiler changes.
Jacob Alexander <haata@kiibohd.com>
parents:
273
diff
changeset
|
141 |
205
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
142 #| 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
|
143 set ( SRCS ${SRCS} ${kll_outputname} ) |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
144 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
145 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
146 |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
147 endif () # PartialMap |
a2e9bb170eef
Adding CMake build support for the KLL compiler
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
148 |