This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
323 lines (293 loc) · 12.6 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
message(WARNING [[
This instance of IXM is deprecated, and will be archived and locked on
2022-09-01
Please update your FetchContent_Declare calls to point to
https://legacy.ixm.one
After this date, your projects will no longer work when reaching
https://get.ixm.one
I am sorry that this was never properly released. IXM will eventually return, but massively reduced in scope.
If you have somehow gotten this warning, I would like to thank you for trusting this project.
IXM was an ambitious project. CMake has changed. The world has changed. IXM must also change.
]])
set(IXM_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "IXM install root")
set(IXM_MODULE_ROOT "${IXM_ROOT}/Modules" CACHE INTERNAL "IXM Module Root")
set(CMake_MODULE_ROOT "${CMAKE_ROOT}/Modules" CACHE INTERNAL "CMake Module Root")
list(APPEND CMAKE_MODULE_PATH "${IXM_ROOT}/Languages")
list(APPEND CMAKE_MODULE_PATH "${IXM_ROOT}/Packages")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE)
include("${IXM_ROOT}/Modules/API/Import.cmake")
list(PREPEND CMAKE_MODULE_PATH "${IXM_MODULE_ROOT}/API")
include(CMake)
import(IXM::API::*)
set(IXM_STDOUT_LOG "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeOutput.log" CACHE INTERNAL "")
set(IXM_STDERR_LOG "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeError.log" CACHE INTERNAL "")
# Disables in source tree builds. Most projects do this to *some* degree
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
# These are used for bookkeeping and RAII
variable_watch(CMAKE_FIND_PACKAGE_NAME cmake::package)
variable_watch(CMAKE_CURRENT_LIST_DIR cmake::directory)
# TODO: Enforce this only at the directory level
# Not used for external customization
set_property(GLOBAL PROPERTY ixm::blueprint::file)
set_property(GLOBAL PROPERTY ixm::blueprint::name)
# Application Directory Settings
if (CMAKE_HOST_APPLE)
if (NOT DEFINED ENV{XDG_CONFIG_HOME})
set(ENV{XDG_CONFIG_HOME} "$ENV{HOME}/Library/Application Support")
endif()
if (NOT DEFINED ENV{XDG_CACHE_HOME})
set(ENV{XDG_CACHE_HOME} "$ENV{HOME}/Library/Caches")
endif()
if (NOT DEFINED ENV{XDG_DATA_HOME})
set(ENV{XDG_DATA_HOME} "$ENV{HOME}/Library")
endif()
endif()
assign(fs-config-home ? ENV{APPDATA} ENV{XDG_CONFIG_HOME} : "$ENV{HOME}/.config")
assign(fs-cache-home ? ENV{LOCALAPPDATA} ENV{XDG_CACHE_HOME} : "$ENV{HOME}/.cache")
assign(fs-data-home ? ENV{LOCALAPPDATA} ENV{XDG_DATA_HOME} : "$ENV{HOME}/.local/share")
set_property(GLOBAL PROPERTY ixm::fs::config "${fs-config-home}/ixm")
set_property(GLOBAL PROPERTY ixm::fs::cache "${fs-cache-home}/ixm")
set_property(GLOBAL PROPERTY ixm::fs::data "${fs-data-home}/ixm")
if (CMAKE_HOST_WIN32)
if (NOT DEFINED ENV{XDG_CACHE_HOME})
set_property(GLOBAL APPEND_STRING PROPERTY ixm::fs::cache "/cache")
endif()
if (NOT DEFINED ENV{XDG_DATA_HOME})
set_property(GLOBAL APPEND_STRING PROPERTY ixm::fs::data "/data")
endif()
endif()
# IXM will try generate the CMake File API
set(CMAKE_API_QUERY_DIR "${CMAKE_BINARY_DIR}/.cmake/api/v1/query")
if (NOT EXISTS "${CMAKE_API_QUERY_DIR}")
file(MAKE_DIRECTORY "${CMAKE_API_QUERY_DIR}")
file(TOUCH
"${CMAKE_API_QUERY_DIR}/codemodel-v2"
"${CMAKE_API_QUERY_DIR}/cache-v2"
"${CMAKE_API_QUERY_DIR}/cmakeFiles-v1")
endif()
# This is temporary. They SHOULD be set to a cache variable of some kind?
set_property(GLOBAL PROPERTY ixm::lint::msvc::macro-redefined 4005)
set_property(GLOBAL PROPERTY ixm::lint::msvc::sign-compare 4018)
set_property(GLOBAL PROPERTY ixm::lint::msvc::unused-parameter 4100)
set_property(GLOBAL PROPERTY ixm::lint::msvc::dllexport-explicit-instantian-decl 4910)
set_property(GLOBAL PROPERTY ixm::lint::msvc::deprecated-declarations 4996)
# Toolchain Aspects
aspect(SET toolchain:raspberrypi WITH "${IXM_ROOT}/Toolchains/RaspberryPi.cmake")
aspect(SET toolchain:arduino WITH "${IXM_ROOT}/Toolchains/Arduino.cmake")
aspect(SET toolchain:android WITH "${IXM_ROOT}/Toolchains/Android.cmake")
aspect(SET toolchain:rpi WITH "${IXM_ROOT}/Toolchains/RaspberryPi.cmake")
aspect(SET toolchain:qnx WITH "${IXM_ROOT}/Toolchains/QNX.cmake")
# Path Aspects
aspect(SET path:generate WITH "${CMAKE_BINARY_DIR}/IXM/Generate")
aspect(SET path:target WITH "${CMAKE_BINARY_DIR}/IXM/Target")
aspect(SET path:invoke WITH "${CMAKE_BINARY_DIR}/IXM/Invoke")
aspect(SET path:fetch WITH "${CMAKE_BINARY_DIR}/IXM/Fetch")
aspect(SET path:check WITH "${CMAKE_BINARY_DIR}/IXM/Check")
aspect(SET path:find WITH "${CMAKE_BINARY_DIR}/IXM/Find")
aspect(SET path:log WITH "${CMAKE_BINARY_DIR}/IXM/Logs")
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
string(TOLOWER "${CMAKE_SYSTEM_NAME}" cmake-system-name)
aspect(GET toolchain:${cmake-system-name} AS CMAKE_TOOLCHAIN_FILE)
unset(cmake-system-name)
endif()
# TODO: Set CMAKE_USER_MAKE_RULES_OVERRIDE so that we can safely guarantee
# that MSVC based projects can use
# set_property(TARGET <name> PROPERTY ENABLE_EXCEPTIONS OFF), which is something
# we're going to (hopefully) provide...
# API Aspects
# check()
aspect(SET check:integral WITH ixm_check_integral)
aspect(SET check:include WITH ixm_check_include)
aspect(SET check:pointer WITH ixm_check_pointer)
aspect(SET check:struct WITH ixm_check_class)
aspect(SET check:class WITH ixm_check_class)
aspect(SET check:union WITH ixm_check_union)
aspect(SET check:enum WITH ixm_check_enum)
aspect(SET check:alignof WITH ixm_check_alignof)
aspect(SET check:sizeof WITH ixm_check_size)
# source extension aspects
aspect(SET source:proto WITH "PROTOBUF")
aspect(SET source:pyx WITH "CYTHON")
aspect(SET source:rst WITH "SPHINX")
aspect(SET source:md WITH "MARKDOWN")
# fetch() aspects
aspect(SET fetch:hub WITH ixm_fetch_hub)
aspect(SET fetch:lab WITH ixm_fetch_lab)
aspect(SET fetch:bit WITH ixm_fetch_bit)
aspect(SET fetch:bin WITH ixm_fetch_bin)
aspect(SET fetch:url WITH ixm_fetch_url)
aspect(SET fetch:add WITH ixm_fetch_add)
aspect(SET fetch:use WITH ixm_fetch_use)
aspect(SET fetch:git WITH ixm_fetch_git)
aspect(SET fetch:svn WITH ixm_fetch_svn)
aspect(SET fetch:cvs WITH ixm_fetch_cvs)
aspect(SET fetch:hg WITH ixm_fetch_hg)
# generate() aspects
aspect(SET generate:rsp WITH ixm_generate_response_file)
aspect(SET generate:bison WITH ixm_generate_bison)
aspect(SET generate:flex WITH ixm_generate_flex)
aspect(SET generate:yacc WITH ixm_generate_bison)
aspect(SET generate:lex WITH ixm_generate_flex)
# log() aspects
aspect(SET log:strftime WITH "%Y-%b-%d@%H:%M:%S")
aspect(SET log:format WITH TEXT FILE)
aspect(SET log:level WITH INFO)
aspect(SET log:color WITH ON)
# message() aspects
aspect(SET print:colors WITH ON)
aspect(SET print:quiet WITH OFF)
if (CMAKE_HOST_WIN32 AND (NOT "$ENV{ConEmuANSI}") AND (NOT CMAKE_GENERATOR STREQUAL "Ninja"))
return()
endif()
console(STYLE reset WITH 0)
console(STYLE bold WITH 1)
console(STYLE dim WITH 2)
console(STYLE italic WITH 3)
console(STYLE under WITH 4)
console(STYLE blink WITH 5)
console(STYLE invert WITH 7)
console(STYLE strike WITH 9)
console(STYLE over WITH 53)
console(COLOR alice-blue WITH 240 248 255)
console(COLOR antique-white WITH 250 253 215)
console(COLOR aqua WITH 0 255 255)
console(COLOR aquamarine WITH 127 255 212)
console(COLOR azure WITH 240 255 255)
console(COLOR beige WITH 245 245 220)
console(COLOR bisque WITH 255 228 196)
console(COLOR black WITH 0 0 0)
console(COLOR blanched-almond WITH 255 235 205)
console(COLOR blue WITH 0 0 255)
console(COLOR blue-violet WITH 138 43 226)
console(COLOR brown WITH 165 42 42)
console(COLOR burly-wood WITH 222 184 135)
console(COLOR cadet-blue WITH 95 158 160)
console(COLOR chartreuse WITH 127 255 0)
console(COLOR chocolate WITH 210 105 30)
console(COLOR coral WITH 255 127 80)
console(COLOR cornflower-blue WITH 100 149 237)
console(COLOR cornsilk WITH 255 248 220)
console(COLOR crimson WITH 220 20 60)
console(COLOR cyan WITH 0 255 255)
console(COLOR dark-blue WITH 0 0 139)
console(COLOR dark-cyan WITH 0 139 139)
console(COLOR dark-golden-rod WITH 184 134 11)
console(COLOR dark-gray WITH 169 169 169)
console(COLOR dark-green WITH 0 100 0)
console(COLOR dark-khaki WITH 189 183 107)
console(COLOR dark-magenta WITH 139 0 139)
console(COLOR dark-olive-green WITH 85 107 47)
console(COLOR dark-orange WITH 255 140 0)
console(COLOR dark-orchid WITH 153 50 204)
console(COLOR dark-red WITH 139 0 0)
console(COLOR dark-salmon WITH 233 150 122)
console(COLOR dark-sea-green WITH 143 188 143)
console(COLOR dark-slate-blue WITH 72 61 139)
console(COLOR dark-slate-gray WITH 47 79 79)
console(COLOR dark-turquoise WITH 0 206 209)
console(COLOR dark-violet WITH 148 0 211)
console(COLOR deep-pink WITH 255 20 147)
console(COLOR deep-sky-blue WITH 0 191 255)
console(COLOR dim-gray WITH 105 105 105)
console(COLOR dodger-blue WITH 30 144 255)
console(COLOR fire-brick WITH 178 34 34)
console(COLOR floral-white WITH 255 250 240)
console(COLOR forest-green WITH 34 139 34)
console(COLOR fuchsia WITH 255 0 255)
console(COLOR gainsboro WITH 220 220 220)
console(COLOR ghost-white WITH 248 248 255)
console(COLOR gold WITH 255 215 0)
console(COLOR golden-rod WITH 218 165 32)
console(COLOR gray WITH 128 128 128)
console(COLOR green WITH 0 128 0)
console(COLOR green-yellow WITH 173 255 47)
console(COLOR honey-dew WITH 240 255 240)
console(COLOR hot-pink WITH 255 105 180)
console(COLOR indian-red WITH 205 92 92)
console(COLOR indigo WITH 75 0 130)
console(COLOR ivory WITH 255 255 240)
console(COLOR khaki WITH 240 230 140)
console(COLOR lavender WITH 230 230 250)
console(COLOR lavender-blush WITH 255 240 245)
console(COLOR lawn-green WITH 124 252 0)
console(COLOR lemon-chiffon WITH 255 250 205)
console(COLOR light-blue WITH 173 216 230)
console(COLOR light-coral WITH 240 128 128)
console(COLOR light-cyan WITH 224 255 255)
console(COLOR light-golden-rod-yellow WITH 250 250 210)
console(COLOR light-gray WITH 211 211 211)
console(COLOR light-green WITH 144 238 144)
console(COLOR light-pink WITH 255 182 193)
console(COLOR light-salmon WITH 255 160 122)
console(COLOR light-sea-green WITH 32 178 170)
console(COLOR light-sky-blue WITH 135 206 250)
console(COLOR light-slate-gray WITH 119 136 153)
console(COLOR light-steel-blue WITH 176 196 222)
console(COLOR light-yellow WITH 255 255 224)
console(COLOR lime WITH 0 255 0)
console(COLOR lime-green WITH 50 205 50)
console(COLOR linen WITH 250 240 230)
console(COLOR magenta WITH 255 0 255)
console(COLOR maroon WITH 128 0 0)
console(COLOR medium-aquamarine WITH 102 205 170)
console(COLOR medium-blue WITH 0 0 205)
console(COLOR medium-orchid WITH 186 85 211)
console(COLOR medium-purple WITH 147 112 219)
console(COLOR medium-sea-green WITH 60 179 113)
console(COLOR medium-slate-blue WITH 123 104 238)
console(COLOR medium-spring-green WITH 0 250 154)
console(COLOR medium-turquoise WITH 72 209 204)
console(COLOR medium-violet-red WITH 199 21 133)
console(COLOR midnight-blue WITH 25 25 112)
console(COLOR mint-cream WITH 245 255 250)
console(COLOR misty-rose WITH 255 228 225)
console(COLOR moccasin WITH 255 228 181)
console(COLOR navajo-white WITH 255 222 173)
console(COLOR navy WITH 0 0 128)
console(COLOR old-lace WITH 253 245 230)
console(COLOR olive WITH 128 128 0)
console(COLOR olive-drab WITH 107 142 35)
console(COLOR orange WITH 255 165 0)
console(COLOR orange-red WITH 255 69 0)
console(COLOR orchid WITH 218 112 214)
console(COLOR pale-golden-rod WITH 238 232 170)
console(COLOR pale-green WITH 152 251 152)
console(COLOR pale-turquoise WITH 175 238 238)
console(COLOR pale-violet-red WITH 219 112 147)
console(COLOR papaya-whip WITH 255 239 213)
console(COLOR peach-puff WITH 255 218 185)
console(COLOR peru WITH 205 133 63)
console(COLOR pink WITH 255 192 203)
console(COLOR plum WITH 221 160 221)
console(COLOR powder-blue WITH 176 224 230)
console(COLOR purple WITH 128 0 128)
console(COLOR rebecca-purple WITH 102 51 153)
console(COLOR red WITH 255 0 0)
console(COLOR rosy-brown WITH 188 143 143)
console(COLOR royal-blue WITH 65 105 225)
console(COLOR saddle-brown WITH 139 69 19)
console(COLOR salmon WITH 250 128 114)
console(COLOR sandy-brown WITH 244 164 96)
console(COLOR sea-green WITH 46 139 87)
console(COLOR sea-shell WITH 255 245 238)
console(COLOR sienna WITH 160 82 45)
console(COLOR silver WITH 192 192 192)
console(COLOR sky-blue WITH 135 206 235)
console(COLOR slate-blue WITH 106 90 205)
console(COLOR slate-gray WITH 112 128 144)
console(COLOR snow WITH 255 250 250)
console(COLOR spring-green WITH 0 255 127)
console(COLOR steel-blue WITH 70 130 180)
console(COLOR tan WITH 210 180 140)
console(COLOR teal WITH 0 128 128)
console(COLOR thistle WITH 216 191 216)
console(COLOR tomato WITH 255 99 71)
console(COLOR turquoise WITH 64 224 208)
console(COLOR violet WITH 238 130 238)
console(COLOR wheat WITH 245 222 179)
console(COLOR white WITH 255 255 255)
console(COLOR white-smoke WITH 245 245 245)
console(COLOR yellow WITH 255 255 0)
console(COLOR yellow-green WITH 154 205 50)