diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-08-13 00:45:36 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2020-08-17 17:09:39 +0000 |
commit | b67b08f1c2c26a226db6f43f2452026f85ad6460 (patch) | |
tree | e8aa41c51e6247919d531d9cd35737c98a360ff9 /src/lib/corelib/CMakeLists.txt | |
parent | 2311a8224c3fc7141c44cc517f4ecdb882cd09f8 (diff) |
Initial CMake port
This change allows to build Qbs using CMake build tool
Tested platforms
- Linux (gcc)
- macOS (clang)
- Windows (msvc2017)
Missing features (compared to Qbs build)
- Documentation build
- Bundled QtScript support
- Static build
- .pc file for qbscore
- qbs module for qbscore
Change-Id: I09b5dadd6723d5a47e5ef2a9a38d3300488718f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/CMakeLists.txt')
-rw-r--r-- | src/lib/corelib/CMakeLists.txt | 460 |
1 files changed, 460 insertions, 0 deletions
diff --git a/src/lib/corelib/CMakeLists.txt b/src/lib/corelib/CMakeLists.txt new file mode 100644 index 000000000..2dfaf225c --- /dev/null +++ b/src/lib/corelib/CMakeLists.txt @@ -0,0 +1,460 @@ +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(corelib + DEFINES + "QBS_VERSION=\"${QBS_VERSION}\"" + "QBS_RELATIVE_LIBEXEC_PATH=\"${QBS_RELATIVE_LIBEXEC_PATH}\"" + ${QBS_UNIT_TESTS_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() |