summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
* Refactor Metatypes dependency propagationLeander Beernaert2020-02-102-23/+0
| | | | | | | | | | | | | | | | Every metatypes.json files is now added as an INTERFACE source file to a target. This enables us later to correctly collect all the metatypes.json files from dependent targets. This information is also correctly exported via export()/install(). To avoid the metatypes.json appearing in every target's source list, the file path is wrapped in a generator expression which will only be evaluated when the consuming target has the property QT_CONSUMES_METATYPES set to true. At the moment this is limited to targets which need to interact with qmltyperegistrar. Change-Id: I0ffebcd069a923383f7ed11cde2c94ecf2fb13f3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't add private module headers for private modules when not neededAlexandru Croitor2020-02-061-4/+5
| | | | | | | | | | | | | | | If a module has the NO_MODULE_HEADERS option, we should not add the private module header paths to the BUILD_INTERFACE of private modules. This fixes building static non-prefix qtdeclarative builds on Linux, where non-existent QtXcbQpa headers failed the qtdeclarative generation step. Change-Id: Ic9fdd8c5688d3449576eb8a5dd852c252e29bf5b Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove qt_add_qml_module() from QtBuildLeander Beernaert2020-02-061-169/+0
| | | | | | | | This bit is being move to QtDeclarative as it is not required to build QtBase. Change-Id: I7b559b8b0e33e66d92c97c93bc43b650e7150237 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Load module specific extensions for QtBuildInternalsLeander Beernaert2020-02-062-0/+14
| | | | | | | | | | | | This patch enables each module to load their own Qt${version}ModuleBuildInternals.cmake to expose module specific features when building Qt. These scripts are only loaded when the package QtBuildInternals has been loaded. Change-Id: Ie58dd93ddd292cf106fe7ef147151a51fd5aa2b1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Safeguard against multiple definition of dbus-1 targetLeander Beernaert2020-02-061-0/+4
| | | | | | Change-Id: Ibba9ce7ce472fe2939386065087f0b07ad811c3f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix qt_add_qml_module() for non-prefix buildsLeander Beernaert2020-02-051-14/+18
| | | | | | | | | | | | | | Always set the installation directory for Qml modules as it is required for qt6_add_qml_module() to set the correct properties so that qml files can be copied to the right location. This patch also fixes the copy of qmldir. As it previously stood, the copied file was not complete as it is possible fore the contents to change after we exit this function. Change-Id: I974269cf0507664b005a93bf27ab19941d99f1d6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow manually specification of moc.json files for metatype generationLeander Beernaert2020-02-051-2/+17
| | | | | | | | | | | | | | qt6_generate_meta_types_json_file() has been extended to allow the generated moc_....cpp.json files to be manually specified. This now enabled the metatype generation to be used without resorting to AUTOMOC. Additionally, Core_qobject declaration order has been temporarily moved as it otherwise does not produce the correct metatypes dependency file for Core. This will be fixed in a follow up patch. Change-Id: I3266ab3073db478458a0c1dbc8b9fbab16622a64 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Handle QT += core-private correctly for modulesAlexandru Croitor2020-02-051-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a module project (Quick) contains QT += core-private, the qmake semantics translated to CMake would mean the following: target_link_libraries(Quick PUBLIC Core) target_link_libraries(Quick PRIVATE CorePrivate) target_link_libraries(QuickPrivate INTERFACE CorePrivate) Whereas a QT_PRIVATE += core-private only means target_link_libraries(Quick PRIVATE CorePrivate) without adding any public dependencies to QuickPrivate. To achieve that, we need a few modifications to both pro2cmake and QtBuild.cmake - pro2cmake doesn't automagically add public and private dependencies to targets when encountering a private module assigned to QT. Instead it generates the logic described above by passing correct LIBRARIES, PUBLIC_LIBRARIES, and PRIVATE_MODULE_INTERFACE values. - pro2cmake doesn't do any dependency magic for non-module targets anymore, like executables, plugins, internal_modules. This means that QT assignments are now regular public dependencies. - qt_add_module and qt_extend_target now accept a new PRIVATE_MODULE_INTERFACE option. - qt_extend_target does not automagically make private modules be public dependencies on other private modules. - qt_extend_target correctly assigns PRIVATE_MODULE_INTERFACE values to Private module only. For other target types, it's a no-op. The change requires regeneration of all projects. When we fix pro2cmake and QtBuild.cmake to properly handle internal_modules (create only Private modules without creating a non-Private counter part), we will need another project regeneration to correctly assign dependencies. Change-Id: I4c21f26b3ef3b2a4ed208b58bccb65a5b7312f81 Task-number: QTBUG-81780 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add additional include path for DRMSamuli Piippo2020-02-051-1/+7
| | | | | | | | | | | Tegra has drm.h header in include/drm instead of include/libdrm Both paths are defined in libdrm.pc, but those are not used since this cmake file searches only for xf86drm.h. Change-Id: If1e979c7d5aec520b18eed5b3fcbb5ac2e15cc62 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qtbase: don't use neon flags on arm64Samuli Piippo2020-02-051-1/+1
| | | | | | | | | NEON is mandatory for aarch64 and compiler doesn't recognize -mfpu=neon commandline argument. Change-Id: I36e9c40e3fd3604d4895da0526152e90b2165770 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qtbase: use syncqt.pl from QT_HOST_PATHSamuli Piippo2020-02-051-0/+6
| | | | | | | | | | Use syncqt.pl from QT_HOST_PATH if that is given, since qtbase sources might not be available and CMAKE_INSTALL_PREFIX doesn't check for sysroot. Change-Id: I165b17a5a02fd4dbb2340bf69a641b8aaab8fabd Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove retained quick compiler resource filesLeander Beernaert2020-02-051-22/+1
| | | | | | | | | Remove retained file feature as the expected behavior now is for the compiled file to be retained by default. Change-Id: I5a791a182825b223eb4497970fbb1c47c70135cc Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update add_custom_command and add_custom_target dependenciesLeander Beernaert2020-02-033-11/+30
| | | | | | | | | | | If we don't add the executable used by the custom_target and/or custom_command to list of the command's/target's dependencies (DEPENDS) the generated file will not update should the executable change. Change-Id: Idce30f3dd4f756d9e8f6848c5e16f5dd6c7c8f0a Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't hardcode the include directory nameChristophe Giboudeaux2020-01-313-8/+8
| | | | | | | | | | | | Hardcoding "lib" caused build issues and wrong INTERFACE_INCLUDE_DIRECTORIES paths in generated CMake configuration files if INSTALL_INCLUDEDIR pointed to a different location. Contributes to QTBUG-81289 Change-Id: I3276ecbb4bf5df1c0b4c496c0287b4a69586d683 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't hardcode the library directory nameChristophe Giboudeaux2020-01-311-3/+3
| | | | | | | | | INSTALL_LIBDIR may point to a different directory than "lib". Contributes to QTBUG-81289 Change-Id: Ia8220515e3ee3703539aa28655e6c806736615ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't hardcode the binary directory nameChristophe Giboudeaux2020-01-312-14/+14
| | | | | | | | | | | INSTALL_BINDIR may point to a different location than "bin". In order to avoid errors when trying to install qtbase, "bin" is replaced with "INSTALL_BINDIR" where necessary. Contributes to QTBUG-81289 Change-Id: I1d4f9fb2617547c9b0e44d6690caebb2b6768e2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add INSTALL_MKSPECSDIR to the install locationsChristophe Giboudeaux2020-01-312-10/+24
| | | | | | | | | | | | | Linux distributions may want to install mkspecs files into a different subdir in order to make Qt6 co-installable with older versions. Contributes to QTBUG-81289 Change-Id: Ie4a64370d742948d5ca4f2eaed6ea550d2676707 Reviewed-by: Qt CMake Build Bot Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix CMAKE_BUILD_TYPE to be force setAlexandru Croitor2020-01-301-1/+5
| | | | | | | | | | | Otherwise CMake sets an up an empty default value itself, and then the value in QtBuildInternalsExtra does not end up being used, and then QtSetup ends up setting a Debug value. Amends 34a112e383d4ce3f6fe7417c1873fd3b33176032 Change-Id: If97a1d8c19ad5e7f690283997ff80dd9588cd521 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Append to AUTO_MOC_OPTIONS in order not override existing valueLeander Beernaert2020-01-291-2/+4
| | | | | Change-Id: Id1bf607e31ee2baa5ffb6d6b4aedd98ea83e5e15 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Only add --automoc-json to AUTOMOC_OPTIONS for metatypes targetsLeander Beernaert2020-01-291-1/+0
| | | | | Change-Id: I7c2e859a83ea78c2a6cf2ad59c175c1b29a74621 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Generate metatypes dependency fileLeander Beernaert2020-01-292-20/+37
| | | | | | | | | | | | | | | | Due to generator expression it is impossible to recursively evaluate the link dependencies of a target. This is required by QtDeclarative's qmltyperegistrar. To overcome this we generate a ${target}_metatypes_dep.txt file which contain lines with the following pattern: ${PATH_TO_METATYPES.json}=${PATH_TO_METATYPES_DEP.txt} This can be used to recursively evaluate the dependencies at run time. Change-Id: Ia4cee0632c16ba9631e0289db906fe9d320844a3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix CMAKE_BUILD_TYPE to be a cache variable in QtBuildInternalsExtraAlexandru Croitor2020-01-292-8/+2
| | | | | | | | | | Rather than pass the build type in the wrapper, make sure the build type is a cache var, so it gets picked up when building other repos. This reverts commit f72ca4cf853619efb99ab08da803536392229d37. Change-Id: I5d91ab66249b6c40c5e548b0eec0e467ba0f2ebc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Forward CMAKE_BUILD_TYPE, if available, in qt-cmakeLeander Beernaert2020-01-291-1/+7
| | | | | Change-Id: I299e16cfc084b3fc009e806902e26121ebdd454b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Don't create convenience plugin target when not neededAlexandru Croitor2020-01-271-1/+1
| | | | | | | | | | | If the OUTPUT_NAME of a plugin is the same as the CMake target name, don't try to create a custom target with the same name. That will cause configuration errors due to duplicate targets. Amends f67d8ae2d4339c50cf0a4ca26f25c3afebc128ea Change-Id: Iaea7c68e22dbc1e345ba10950c312618abba4c21 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix qt_import_plugins compatibility with Qt 5Alexandru Croitor2020-01-271-1/+18
| | | | | | | | | | Handle versionless plugin names passed to qt_import_plugins. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Change-Id: Ic7fb6e54d2822c7eb58a7874b4a1c137f0c101d9 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix plugin target names to be compatible with Qt 5Alexandru Croitor2020-01-271-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, qmake generates CMake Config files which expose the plugins as imported libraries. The name of these libraries are derived from the plugin class name. So QCocoaIntegrationPlugin, and not qcocoa. To keep compatibility between Qt5 and Qt6 CMake target names, the pro2cmake script should generate plugin target names based on the plugin class names. To avoid passing the same name in qt_add_plugin (target and CLASS_NAME), derive the class name from the target if the class name is not explicitly specified. Also add a new OUTPUT_NAME parameter which is used to change the final file name of the plugin, so that it's compatible with Qt5. For example to generate a qcocoa.dylib file, instead of QCocoaIntegrationPlugin.dylib file. The same OUTPUT_NAME value will be used for generation of plugin .prl files for qmake consumption. Change-Id: I4d53e680d7beb62befecd359cdf6bba60a34ff0d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add initial support for CMake "Ninja Multi-Config" generatorAlexandru Croitor2020-01-277-9/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows doing debug_and_release builds with Ninja on all platforms. The "Ninja Multi-Config generator" is available starting with CMake 3.17. Desired configurations can be set via CMAKE_CONFIGURATION_TYPES. Possible values: "Release, Debug, RelWithDebInfo, MinRelSize". For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug". The first configuration is the 'default' configuration which is built when calling ninja with no arguments. To build all targets of a certain configuration use "ninja all:Release" or "ninja all:Debug". To build all targets in all configurations use "ninja all:all". Note that the first configuration influences which configuration of tools will be used when building the libraries for all configurations. In simple terms, when configured with -DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc is used by AUTOMOC. When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release" the debug version of moc is used by AUTOMOC. Framework builds and Ninja Multi-Config don't currently work together due to multiple bugs in CMake, which ends up generating an invalid ninja file with duplicate rules. There are also issues with placement of the debug artifacts. This will be handled in a follow up patch after CMake is fixed. Task-number: QTBUG-76899 Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Support for QML Type RegistrarLeander Beernaert2020-01-241-71/+7
| | | | | Change-Id: Ifc1f44cf40b22c20ab768333ba9d5ce58a5f7250 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix dependencies for SIMD object libraries in macOS framework buildsAlexandru Croitor2020-01-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This manifested in Coin when ninja tried to build qdrawhelper_sse2.cpp before the Core framework headers were copied, resulting in a fatal error: 'qatomic.h' file not found. Make sure every SIMD object library has all PRIVATE dependencies of its parent library PRIVATE dependencies (except for other SIMD object libraries), to make sure that the framework headers are copied by the time the SIMD source file is compiled. Here's an example for clarification. Gui_simd_sse2's LINK_LIBRARIES property should have all the values of Gui's LINK_LIBRARIES property (like Qt::Core) filtering out all SIMD object library targets ( like Gui_simd_sse2, Gui_simd_sse3, etc). Thus we make sure the SIMD object libraries are built after Gui's dependencies are built. Note that using INTERFACE_LINK_LIBRARIES to avoid the filtering of SIMD targets in the generator expression would only work in shared Qt builds. In static Qt builds where PRIVATE dependencies become PUBLIC, CMake would insert $<LINK_ONLY:Gui_simd_foo> entries in INTERFACE_LINK_LIBRARIES which causes CMake to be confused and fail at generation time. Change-Id: I246c1394b9c9830c0ebd11e6621e56b992a6a1f2 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QT_TEST_RUNNING_IN_CTEST environment variable for testLeander Beernaert2020-01-141-1/+1
| | | | | | | | | | | | | When running tests with CMake's CTest, set the environment QT_TEST_RUNNING_IN_CTEST to 1. This can be useful to deal with tests that do not properly work when running from CTest. For instance, the qmake test in this patch has one test that only works when not run from CTest. Change-Id: I01eea9131de69c18118a9ed9f96e9296d5ea20f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for test timeoutsLeander Beernaert2020-01-131-1/+4
| | | | | Change-Id: Iba805cbc16d179e5b080ccc00542329270075aa1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Generator Expression for static non-prefix buildsLeander Beernaert2020-01-101-1/+1
| | | | | Change-Id: Icd32164943d7bb0639de3022bae749d0010674fc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement qtbase fixes for superbuildsJean-Michaƫl Celerier2020-01-0810-79/+165
| | | | | | Change-Id: I0d3445cf0740e3925fa9342dac4d07892518afe5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix is_framework check for interface librariesLeander Beernaert2020-01-061-1/+6
| | | | | | Change-Id: I59832e698eceb98a2a03f4a3e2de88b1d18fda6e Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Add support for framework buildsJoerg Bornemann2020-01-061-36/+201
| | | | | | | | | | Framework builds are enabled by default on macOS. They are controlled via the framework feature. Task-number: QTBUG-75751 Change-Id: I00bc64672f02bbd1672508b2b5010d202984a961 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot
* Add custom targets for documentationLeander Beernaert2019-12-182-1/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds custom targets which take care of generating and installing documentation files. Every module has a global set of targets suffixed with the module name in order for them to be unique when we implement super builds. The targets are the same as the list below, but replace ${target} with the module's name. Eg.: docs_qtbase. For every target which has an qt_add_docs() call, we now create the following set of custom targets: * docs_${target} * html_docs_${target} * qch_docs_${target} * prepare_docs_${target} * generate_docs_${target} * install_docs_${target} * install_html_docs_${target} * install_qch_docs_${target} Fixes: QTBUG-75859 Change-Id: Ie84cb9a2dedbe7333d9a84f4d73383442deca477 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Expose Patch Version in QtConfig.cmakeLeander Beernaert2019-12-112-3/+6
| | | | | Change-Id: I2166d480c0b717fc9137f8eb42d5aab7a091395d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add option to specify working directory for qt_add_testLeander Beernaert2019-12-101-2/+8
| | | | | | Change-Id: Iba5104cccdc613f7b2cf0d1454209578adaac824 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake/README.md: Clarify some pointsFriedemann Kleint2019-12-091-4/+6
| | | | | | | | | - Mention location of the configure.cmake - Specify the path to the conversion scripts Change-Id: Ia6e13a1f4d2c29f2fbaf35acdd70ab16c7175d37 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure to install QtModuleToolsVersionlessTargets.cmake.inAlexandru Croitor2019-12-061-0/+1
| | | | | | | | | | | | Amends 04d895681adab24829be44c392534bcbe9d6c106 Task-number: QTBUG-74137 Task-number: QTBUG-80477 Task-number: QTBUG-75984 Change-Id: I617c2abf421bc1378545e5a36fd44533131ef471 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix creation of versionless targets for toolsAlexandru Croitor2019-12-065-7/+47
| | | | | | | | | | | | | | | | | | We can't use qt_internal_export_modern_cmake_config_targets_file for executables like tools, because it's not possible to use INTERFACE_LINK_LIBRARIES with executables like you can with libraries. We also can't create aliases to non-global imported targets. Instead create new imported executable targets, fish out the imported location, and assign it to the versionless targets. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Task-number: QTBUG-75984 Change-Id: I6a3c9c67ef4699c72a6c9a627c63158dfd6557f8 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix meta types json file install for non-prefix buildsLeander Beernaert2019-12-051-1/+10
| | | | | Change-Id: I76fd379dacb7db79d4ed6ca47954ae8e703842d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clear QT_KNOWN_MODULE_${module}_TOOLS cache vars on reconfigurationAlexandru Croitor2019-12-051-0/+2
| | | | | | | | | | Otherwise if you configured a commit that has tool A, and the switch to a commit where tool A does not exist anymore, reconfiguration will fail. Change-Id: Ibb244b9630a6f4fecd27d51ce28eceff07ba8666 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Collect Json Metatypes from CMake's AutomocLeander Beernaert2019-12-041-1/+14
| | | | | | | | | | | | | | | | | | | | This patch adds a new bootstrap tool which will read CMake's AutoGenInfo.json and ParseCache.txt to determine what the current list of json files is that needs to be passed to moc --collect-json option. Right now this is enabled for qt_add_module() with the option GENERATE_METATYPES. pro2cmake has also been updated to detect qmake's CONFIG += metatypes and to generate the above option for modules. The implementation lives in Qt6CoreMacros so it can eventually be used in the public facing apis. The generated meta types file is saved under the target property QT_MODULE_META_TYPES_FILE. Change-Id: I03709c662be81dd0912d0068c23ee2507bfe4383 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't export private include paths if there are no private includesAlexandru Croitor2019-12-031-3/+6
| | | | | | | | | | | | Needed when building Qt Creator with CMake + Qt6 non-prefix build. Specifically qttools's QtUiPlugin does not have any private headers, but the non-existing include path was exported, which caused an error when configuring Qt Creator. Change-Id: I662bc502fe3134fba083bde273b7f63fe1470277 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Export non-private and non-public features and CONFIG valuesAlexandru Croitor2019-12-031-1/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we only exported features that had outputType PUBLIC or PRIVATE on the various "QT_ENABLED_PUBLIC_FEATURES" target properties. Now we also export features that have output type privateConfig, publicConfig and publicQtConfig. The new properties names are: - QT_QMAKE_PUBLIC_CONFIG for outputType == publicConfig - QT_QMAKE_PRIVATE_CONFIG for outputType == privateConfig - QT_QMAKE_PUBLIC_QT_CONFIG for outputType == publicQtConfig These need to be exported for 2 reasons: - other modules that need to check the config values - in preparation for generating proper qmake .prl and .pri information for each module Note that the config values are now considered actual features when doing condition evaluation. So if there exists a feature "ssse3" with outputType privateConfig, its enabled state can be checked via QT_FEATURE_ssse3 in consuming modules (but not in the declaring module). These config values are also placed in the respective QT_ENABLED_PUBLIC_FEATURES, QT_ENABLED_PRIVATE_FEATURES properties when exporting a target, so the properties will now contain both features and config values. In order to make this work, feature name normalization has to happen at CMake time, rather than done by the python script. This means that features like "developer-build" need to retain the dash in the qt_feature(), qt_feature_definition() and qt_feature_config() calls, rather than generating "developer_build" as the script did before. The normalization is done at CMake time. Feature conditions, CMake code, and -DFEATURE_foo=bar options passed on the command line should still use the underscore version, but the original name is used for the QT_QMAKE_PUBLIC_CONFIG properties. Note that "c++11" like features are normalized to "cxx11". Implementation wise, the configurejson2cmake script is adjusted to parse these new output types. Also QtBuild and QtFeature are adjusted to save the config values in properties, and re-export them from GlobalConfig to Core. Task-number: QTBUG-75666 Task-number: QTBUG-78178 Change-Id: Ibd4b152e372bdf2d09ed117644f2f2ac53ec5e75 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add initial support for cross-building to iOSAlexandru Croitor2019-12-0311-29/+332
| | | | | | | | | | | | | | | | | | | | | | Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Cache qt_config_compile_test resultsAlexandru Croitor2019-12-021-0/+4
| | | | | | | | | | | | | | | | Inside qt_config_compile_test we use two different calls: check_cxx_source_compiles when given code, and try_compile when given a project. The former caches its results, while the latter does not, which means that the try_compile calls are re-executed on each reconfigure. Do what check_cxx_source_compiles does internally, and don't rerun the try_compile calls if the results were computed once. Change-Id: I2691ff08b7bb46c3fa60bbf5ed6278731c9b8e21 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Provide a way to specify extra tool package dependenciesAlexandru Croitor2019-11-263-21/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the qtwayland repo, both WaylandClient and WaylandCompositor packages need access to the qtwaylandscanner tool. That means that the add_qt_tool(qtwaylandscanner) can't use the TOOLS_TARGET argument to associate a dependency with only one of the above modules. Instead add_qt_tool now allows specifying a non-existent module name for the TOOLS_TARGET argument, which can be manually depended on by other packages. Actually, you could specify the non-existent module before as well, but that didn't do everything that had to be done. This required a bit of refactoring in how the Dependencies file for Tools packages is created. Now the file is created in qt_export_tools. Two new functions were also added to allow recording additional dependencies between packages. Also some bug fixes were done to make it all work. Specifically the _FOUND variable generated in the Dependencies file was incorrect. Also there are some quotes missing when appending extra package dependencies via the QT_EXTRA_PACKAGE_DEPENDENCIES property. Change-Id: I167efec16dff8d036e191df3572ea72764e22bc5 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>