aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/CMakeLists.txt
blob: a687eb0adf623b6d312283129bfeb1f8b5aee743 (plain)
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
set(QBS_HEADERS qbs.h)

set(FILE_UPDATE_SOURCES
    changeset.cpp
    changeset.h
    projectfileupdater.cpp
    projectfileupdater.h
    qmljsrewriter.cpp
    qmljsrewriter.h
    )
list_transform_prepend(FILE_UPDATE_SOURCES api/)

set(API_SOURCES
    internaljobs.cpp
    internaljobs.h
    jobs.cpp
    languageinfo.cpp
    project.cpp
    project_p.h
    projectdata.cpp
    projectdata_p.h
    propertymap_p.h
    rulecommand.cpp
    rulecommand_p.h
    runenvironment.cpp
    transformerdata.cpp
    transformerdata_p.h
    )
list_transform_prepend(API_SOURCES api/)

set(API_HEADERS
    jobs.h
    languageinfo.h
    project.h
    projectdata.h
    rulecommand.h
    runenvironment.h
    transformerdata.h
    )
list_transform_prepend(API_HEADERS api/)

set(BUILD_GRAPH_SOURCES
    abstractcommandexecutor.cpp
    abstractcommandexecutor.h
    artifact.cpp
    artifact.h
    artifactcleaner.cpp
    artifactcleaner.h
    artifactsscriptvalue.cpp
    artifactsscriptvalue.h
    artifactvisitor.cpp
    artifactvisitor.h
    buildgraph.cpp
    buildgraph.h
    buildgraphnode.cpp
    buildgraphnode.h
    buildgraphloader.cpp
    buildgraphloader.h
    buildgraphvisitor.h
    cycledetector.cpp
    cycledetector.h
    dependencyparametersscriptvalue.cpp
    dependencyparametersscriptvalue.h
    depscanner.cpp
    depscanner.h
    emptydirectoriesremover.cpp
    emptydirectoriesremover.h
    environmentscriptrunner.cpp
    environmentscriptrunner.h
    executor.cpp
    executor.h
    executorjob.cpp
    executorjob.h
    filedependency.cpp
    filedependency.h
    inputartifactscanner.cpp
    inputartifactscanner.h
    jscommandexecutor.cpp
    jscommandexecutor.h
    nodeset.cpp
    nodeset.h
    nodetreedumper.cpp
    nodetreedumper.h
    processcommandexecutor.cpp
    processcommandexecutor.h
    productbuilddata.cpp
    productbuilddata.h
    productinstaller.cpp
    productinstaller.h
    projectbuilddata.cpp
    projectbuilddata.h
    qtmocscanner.cpp
    qtmocscanner.h
    rawscanneddependency.cpp
    rawscanneddependency.h
    rawscanresults.cpp
    rawscanresults.h
    requestedartifacts.cpp
    requestedartifacts.h
    requesteddependencies.cpp
    requesteddependencies.h
    rescuableartifactdata.h
    rulecommands.cpp
    rulecommands.h
    rulegraph.cpp
    rulegraph.h
    rulenode.cpp
    rulenode.h
    rulesapplicator.cpp
    rulesapplicator.h
    rulesevaluationcontext.cpp
    rulesevaluationcontext.h
    scriptclasspropertyiterator.h
    timestampsupdater.cpp
    timestampsupdater.h
    transformer.cpp
    transformer.h
    transformerchangetracking.cpp
    transformerchangetracking.h
    )
list_transform_prepend(BUILD_GRAPH_SOURCES buildgraph/)

set(BUILD_GRAPH_HEADERS buildgraph/forward_decls.h)

set(GENERATORS_SOURCES
    generatableprojectiterator.cpp
    generatableprojectiterator.h
    generator.cpp
    generatordata.cpp
    generatorutils.cpp
    generatorutils.h
    generatorversioninfo.cpp
    generatorversioninfo.h
    igeneratableprojectvisitor.h
    ixmlnodevisitor.h
    xmlproject.cpp
    xmlproject.h
    xmlprojectwriter.cpp
    xmlprojectwriter.h
    xmlproperty.cpp
    xmlproperty.h
    xmlpropertygroup.cpp
    xmlpropertygroup.h
    xmlworkspace.cpp
    xmlworkspace.h
    xmlworkspacewriter.cpp
    xmlworkspacewriter.h
    )
list_transform_prepend(GENERATORS_SOURCES generators/)

set(GENERATORS_HEADERS generators/generator.h generators/generatordata.h)

set(JS_EXTENSIONS_SOURCES
    environmentextension.cpp
    file.cpp
    fileinfoextension.cpp
    jsextensions.cpp
    jsextensions.h
    moduleproperties.cpp
    moduleproperties.h
    process.cpp
    temporarydir.cpp
    textfile.cpp
    binaryfile.cpp
    utilitiesextension.cpp
    domxml.cpp
    )
list_transform_prepend(JS_EXTENSIONS_SOURCES jsextensions/)

if(APPLE)
    set(JS_EXTENSIONS_MACOS_SOURCES
        propertylist_darwin.h
        propertylist_darwin.mm
        propertylistutils.h
        propertylistutils.mm
        )
else()
    set(JS_EXTENSIONS_MACOS_SOURCES propertylist.cpp)
endif()
list_transform_prepend(JS_EXTENSIONS_MACOS_SOURCES jsextensions/)

set(LANGUAGE_SOURCES
    artifactproperties.cpp
    artifactproperties.h
    astimportshandler.cpp
    astimportshandler.h
    astpropertiesitemhandler.cpp
    astpropertiesitemhandler.h
    asttools.cpp
    asttools.h
    builtindeclarations.cpp
    builtindeclarations.h
    deprecationinfo.h
    evaluationdata.h
    evaluator.cpp
    evaluator.h
    evaluatorscriptclass.cpp
    evaluatorscriptclass.h
    filecontext.cpp
    filecontext.h
    filecontextbase.cpp
    filecontextbase.h
    filetags.cpp
    filetags.h
    identifiersearch.cpp
    identifiersearch.h
    item.cpp
    item.h
    itemdeclaration.cpp
    itemdeclaration.h
    itemobserver.h
    itempool.cpp
    itempool.h
    itemreader.cpp
    itemreader.h
    itemreaderastvisitor.cpp
    itemreaderastvisitor.h
    itemreadervisitorstate.cpp
    itemreadervisitorstate.h
    itemtype.h
    jsimports.h
    language.cpp
    language.h
    loader.cpp
    loader.h
    moduleloader.cpp
    moduleloader.h
    modulemerger.cpp
    modulemerger.h
    moduleproviderinfo.h
    preparescriptobserver.cpp
    preparescriptobserver.h
    projectresolver.cpp
    projectresolver.h
    property.cpp
    property.h
    propertydeclaration.cpp
    propertydeclaration.h
    propertymapinternal.cpp
    propertymapinternal.h
    qualifiedid.cpp
    qualifiedid.h
    resolvedfilecontext.cpp
    resolvedfilecontext.h
    scriptengine.cpp
    scriptengine.h
    scriptimporter.cpp
    scriptimporter.h
    scriptpropertyobserver.cpp
    scriptpropertyobserver.h
    value.cpp
    value.h
    )
list_transform_prepend(LANGUAGE_SOURCES language/)

set(LANGUAGE_HEADERS language/forward_decls.h)

set(LOGGING_SOURCES
    categories.cpp
    categories.h
    ilogsink.cpp
    logger.cpp
    logger.h
    translator.h
    )
list_transform_prepend(LOGGING_SOURCES logging/)

set(LOGGING_HEADERS logging/ilogsink.h)

set(PARSER_SOURCES
    qmlerror.cpp
    qmlerror.h
    qmljsast.cpp
    qmljsast_p.h
    qmljsastfwd_p.h
    qmljsastvisitor.cpp
    qmljsastvisitor_p.h
    qmljsengine_p.cpp
    qmljsengine_p.h
    qmljsglobal_p.h
    qmljsgrammar.cpp
    qmljsgrammar_p.h
    qmljskeywords_p.h
    qmljslexer.cpp
    qmljslexer_p.h
    qmljsmemorypool_p.h
    qmljsparser.cpp
    qmljsparser_p.h
    )
list_transform_prepend(PARSER_SOURCES parser/)

set(TOOLS_SOURCES
    architectures.cpp
    buildgraphlocker.cpp
    buildgraphlocker.h
    buildoptions.cpp
    clangclinfo.cpp
    clangclinfo.h
    cleanoptions.cpp
    codelocation.cpp
    commandechomode.cpp
    dynamictypecheck.h
    error.cpp
    executablefinder.cpp
    executablefinder.h
    fileinfo.cpp
    fileinfo.h
    filesaver.cpp
    filesaver.h
    filetime.cpp
    filetime.h
    generateoptions.cpp
    hostosinfo.h
    id.cpp
    id.h
    iosutils.h
    joblimits.cpp
    jsliterals.cpp
    jsliterals.h
    jsonhelper.h
    installoptions.cpp
    launcherinterface.cpp
    launcherinterface.h
    launcherpackets.cpp
    launcherpackets.h
    launchersocket.cpp
    launchersocket.h
    msvcinfo.cpp
    msvcinfo.h
    pathutils.h
    persistence.cpp
    persistence.h
    preferences.cpp
    processresult.cpp
    processresult_p.h
    processutils.cpp
    processutils.h
    profile.cpp
    profiling.cpp
    profiling.h
    progressobserver.cpp
    progressobserver.h
    projectgeneratormanager.cpp
    qbsassert.cpp
    qbsassert.h
    qbspluginmanager.cpp
    qbspluginmanager.h
    qbsprocess.cpp
    qbsprocess.h
    qttools.cpp
    qttools.h
    scannerpluginmanager.cpp
    scannerpluginmanager.h
    scripttools.cpp
    scripttools.h
    set.h
    settings.cpp
    settingscreator.cpp
    settingscreator.h
    settingsmodel.cpp
    settingsrepresentation.cpp
    setupprojectparameters.cpp
    shellutils.cpp
    shellutils.h
    stlutils.h
    stringconstants.h
    stringutils.h
    toolchains.cpp
    version.cpp
    visualstudioversioninfo.cpp
    visualstudioversioninfo.h
    vsenvironmentdetector.cpp
    vsenvironmentdetector.h
    weakpointer.h
    )
list_transform_prepend(TOOLS_SOURCES tools/)

set(TOOLS_HEADERS
    architectures.h
    buildoptions.h
    cleanoptions.h
    codelocation.h
    commandechomode.h
    error.h
    generateoptions.h
    installoptions.h
    joblimits.h
    preferences.h
    processresult.h
    profile.h
    projectgeneratormanager.h
    qbs_export.h
    settings.h
    settingsmodel.h
    settingsrepresentation.h
    setupprojectparameters.h
    toolchains.h
    version.h
    )
list_transform_prepend(TOOLS_HEADERS tools/)

set(EXTERNAL_DEPENDS "")
if(APPLE)
    set(TOOLS_MACOS_SOURCES
        applecodesignutils.cpp
        applecodesignutils.h
        )
    list_transform_prepend(TOOLS_MACOS_SOURCES tools/)
    set(EXTERNAL_DEPENDS "-framework Foundation" "-framework Security")
endif()

if(WIN32)
    set(EXTERNAL_DEPENDS "psapi" "shell32")
endif()

add_qbs_library(qbscore
    DEFINES
        "QBS_VERSION=\"${QBS_VERSION}\""
        "QBS_RELATIVE_LIBEXEC_PATH=\"${QBS_RELATIVE_LIBEXEC_PATH}\""
        "QBS_LIBRARY"
        ${QBS_UNIT_TESTS_DEFINES}
    PUBLIC_DEFINES
        ${QBS_PROJECT_FILE_UPDATES_DEFINES}
    DEPENDS
        Qt5::CorePrivate Qt5::Gui Qt5::Network Qt5::Script Qt5::Xml ${EXTERNAL_DEPENDS}
    PUBLIC_DEPENDS
        Qt5::Core
    INCLUDES
        "${CMAKE_CURRENT_SOURCE_DIR}/../.."
    SOURCES
        ${QBS_HEADERS}
        ${FILE_UPDATE_SOURCES}
        ${API_SOURCES}
        ${API_HEADERS}
        ${BUILD_GRAPH_SOURCES}
        ${BUILD_GRAPH_HEADERS}
        ${GENERATORS_SOURCES}
        ${GENERATORS_HEADERS}
        ${JS_EXTENSIONS_SOURCES}
        ${JS_EXTENSIONS_MACOS_SOURCES}
        ${LANGUAGE_SOURCES}
        ${LANGUAGE_HEADERS}
        ${LOGGING_SOURCES}
        ${LOGGING_HEADERS}
        ${PARSER_SOURCES}
        ${TOOLS_SOURCES}
        ${TOOLS_HEADERS}
        ${TOOLS_MACOS_SOURCES}
    )

# not sure if there's a better way to do this
if(INSTALL_PUBLIC_HEADERS)
    install(FILES ${QBS_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR})
    install(FILES ${API_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/api)
    install(FILES ${BUILD_GRAPH_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/buildgraph)
    install(FILES ${GENERATORS_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/generators)
    install(FILES ${LOGGING_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/logging)
    install(FILES ${LANGUAGE_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/language)
    install(FILES ${TOOLS_HEADERS} DESTINATION ${QBS_HEADERS_INSTALL_DIR}/tools)
    set(QMAKE_PRI_FILES use_installed_corelib.pri ../../../qbs_version.pri)
    install(FILES ${QMAKE_PRI_FILES} DESTINATION ${QBS_HEADERS_INSTALL_DIR})
endif()