summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Prepend prefix path after loading toolchain fileSamuli Piippo2020-02-281-3/+3
| | | | | | | | | The original toolchain file may set CMAKE_FIND_ROOT_PATH instead of appending it, which overrides the Qt's path. Change-Id: I69a4bf4be6a999854bb8a84cf5032c6a9b739b2e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate Win32 Resource FilesLeander Beernaert2020-02-251-2/+37
| | | | | | | | | | | | | | Add support to generate win32 resources files through CMake. The functionality is implemented via qt6_generate_win32_rc_file() in Qt6CoreMacros.cmake. Currently qt_add_test(), qt_add_module() and add_qt_gui_executable() call the above function when building on windows. The function itself has been written as part of the public API so it can be called from other locations if required. Change-Id: Id5388b3bf9a2068b36780d8268306326f990778c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add missing linker flags for MSVCLeander Beernaert2020-02-251-0/+6
| | | | | | | | This patch adds missing linker flags for MSVC in order to match qmake's msvc-desktop.conf. Change-Id: Ieb1206dae4517e8d9f36175f8fcebccd30e52d01 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the reduce-relocations featureJoerg Bornemann2020-02-251-0/+15
| | | | | | | | | | As reduce-relocations implies bsymbolic_functions, we also add the -Bsymbolic-functions linker flag. Also, handle the .dynlist files that are passed to the linker by bsymbolic_functions.prf in the qmake build. Change-Id: I535c33fba888596d2f8975b16864bbe9f0a7caa4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow building bundled 3rd party libraries in qtbaseAlexandru Croitor2020-02-2511-94/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few things are needed to accomplish that: - the python scripts do not ignore certain system_foo features anymore (it is a hardcoded list for now just to be safe) - configurejson2cmake now outputs qt_find_package(WrapSystemFoo) calls for bundled libraries (see below) - the harfbuzz .pro file is modified to accommodate pro2cmake not being able to correctly parse some conditional scopes - the freetype .pro file is modified to make sure linking of the library succeeds without duplicate symbol errors, which qmake doesn't encounter due to magical exclusion of cpp files that are included in other cpp files (presumably for include moc_foo.cpp support) - feature evaluation for Core, Gui, Network now happens in the qtbase/src directory, so that bundled libraries can be conditionally built - for each bundled library there are now two FindWrap scripts: - FindWrapSystemFoo which finds an installed library in the system - FindWrapFoo which either uses the system installed library or the built bundled one depending on a condition - projects that intend to use bundled libraries need to link against WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets (this is handled by pro2cmake). Unfortunately manually added qt_find_package(WrapFoo) calls might still be needed as is the case for WrapFreetype and others. - a new cmake/QtFindWrapHelper.cmake file is added that provides a macro to simplify creation of WrapFoo targets that link against a bundled or system library. The implementation is fairly ugly due to CMake macro constraints, but it was deemed better than copy-pasting a bunch of almost identical code across all FindWrapFoo.cmake files. - a qtzlib header-only module is now created when using bundled zlib, to provide public syncqt created headers for consumers that need them. These are projects that have 'QT_PRIVATE += zlib-private' in their .pro files (e.g. qtimageformats, qtlocation, qt3d, etc.) This is unfortunately needed due to QtNetwork using zlib types in its private C++ API. The change includes support for building the following bundled libraries: - zlib - libpng - libjpeg - Freetype - Harfbuzz-ng - PCRE2 The following 3rd party libraries are still using an old implementation within the CMake build system, and should be migrated to the new one in the near future: - double-conversion - Old harfbuzz The are a few libraries that are not yet ported: - system-sqlite - systemxcb - maybe others Among other things, this change allows building qtbase on Windows without requiring vcpkg. Task-number: QTBUG-82167 Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Check for syncqt private headers directory before usingAlexandru Croitor2020-02-251-1/+7
| | | | | | | | | | | | | | | Only existing directory paths should be added to INTERFACE_INCLUDE_DIRECTORIES, otherwise projects fail to configure. If after running syncqt there is no private headers directory created (due to the module not having any _p.h files), such a path should not be added as an interface include path. This fixes consumers of QtZlib, where there are no private headers. Change-Id: I3fd1a7b5eb8f816d178d6d91223baa6f377e6f9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Allow evaluating features before a module is processedAlexandru Croitor2020-02-251-17/+36
| | | | | | | | | | | | | | | Introduce an internal qt_feature_evaluate_features() function which takes a list of configure.cmake paths, and evaluates the features declared in those files, thus setting a bunch of cache variables. This is required to implement the equivalent of what qtbase/src.pro does, which includes the feature .pri files to decide whether bundled 3rd party libraries need to be built. Change-Id: I5552f488671c001eb3f204245b905ab981017a9f Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix FindWrapRt module when it's found multiple timesAlexandru Croitor2020-02-251-6/+9
| | | | | | | | | | | | | | | | | On Windows, when WrapRt is qt_find_pacakge()'d the first time, the result is "not found", whereas a second time it would claim that the package is found. This is due to the WrapRt target being always created even if it has no transitive dependencies, and thus a second search would check only for the existence of the target. Fix the module to only create the target if the relevant library is found. Change-Id: I5c838cbfbafb4029f96da815a0f72e4a8e6716b0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix 3rd party library installationAlexandru Croitor2020-02-251-3/+12
| | | | | | | | | | | | | | | | Libraries created with qt_add_3rdparty_library should be installed when the qmake 'installed' value is set in CONFIG. Introduce a new INSTALL option to handle that in CMake projects. If the value is provided, the library should always be installed regardless of whether it's a shared or static library. Fix the libraries to be installed to BINDIR/LIBDIR instead of the config install dir. Also install the CMake config files into the config install dir. Change-Id: I86f1ef47680f08669a77db77e0d986f47d5fae2d Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Allow creation of modules with no qtfoo-config.h fileAlexandru Croitor2020-02-251-2/+2
| | | | | | | | | | | | | Useful for header only modules that are declared in the same directory as a regular module, but which doesn't have any features and thus has no qtfoo-config.h file. Will be used for the qtzlib module, which is built when system_zlib feature is disabled. Change-Id: I60c5f73c3e2a3a481a16c5872e06d5d109a04b10 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Add functions to allow setting symbol visibility flagsAlexandru Croitor2020-02-251-0/+14
| | | | | | | | Needed for 3rd party library code. Change-Id: Ib994de1980515e849d4368249024d3d5e064fb46 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Allow disabling warnings similar to CONFIG += warn_offAlexandru Croitor2020-02-252-2/+29
| | | | | | | | | | | The QT_COMPILE_OPTIONS_WARNINGS_OFF property can be set on targets in order to disable adding the default compiler warnings flags. This is useful when building 3rd party library code. Change-Id: I9f58ca4543b5ea0d2051b7f94f0042d24c4e3a16 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Set minimum deployment target only for host macOSAlexandru Croitor2020-02-211-1/+2
| | | | | | | | A future change will come that sets it for iOS and friends. Change-Id: I74b688ee62d24137e3cdf5475e1a9e858698ccf0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add missing compile flags for msvcLeander Beernaert2020-02-201-0/+24
| | | | | | | | | This patch adds a couple of missing compile flags that are defined in mkspecs/common/msvc-version.conf and mkspecs/common/msvc-desktop.conf that were not yet ported to CMake. Change-Id: I9ef0ef71cb0c063699fba4c067e90f6515169baf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix use of compile define QT_NO_DEBUGLeander Beernaert2020-02-202-4/+2
| | | | | | | | | | | | Prior to this patch QT_NO_DEBUG would not be correctly set for generators which support multiple configurations such as Visual Studio and XCode. This patch also applies the define to all executables, which was previously missing. Change-Id: I16a911d15217a62093c68ba2b4c2545cdb8df1e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix PATH environment variable for CMake testsLeander Beernaert2020-02-191-1/+3
| | | | | | | | | | | | This patch fixes setting the correct value for the PATH environment value. Currently, due to Windows' ; path separator, every list entry was treated as a separate environment variable that need to be set instead of properly extending the PATH list. Change-Id: Ib2fc031397459370beec84f9cb4ec6df7db00df3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
* Only install tests data for prefix buildsLeander Beernaert2020-02-181-2/+2
| | | | | | | | | | If we install tests data for non-prefix builds it can cause tests to fail as they find the data in the wrong location. An example of this is tst_qsslkey. Change-Id: I55bd2ff4cb5a0857dc857cb2149ffe4436ec6f99 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set qt_add_test WORKING_DIRECTORY to OUTPUT_DIRECTORYLeander Beernaert2020-02-181-0/+2
| | | | | | | | | If qt_add_test() is called with OUTPUT_DIRECTORY and no WORKING_DIRECTORY is specified, default the WORKING_DIRECTORY to the same value as OUTPUT_DIRECTORY._ Change-Id: If373fe590508ad58d4632e0598cd0d9dddb2ae16 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set a default value for CMAKE_OSX_DEPLOYMENT_TARGETAlexandru Croitor2020-02-181-0/+15
| | | | | | | | | | This replicates the behavior of QMAKE_MACOSX_DEPLOYMENT_TARGET in qmake. Change-Id: I273cd26994f2edfc52dc7b6278252c37b65b2356 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use correct C++ standard flag when building standalone testsAlexandru Croitor2020-02-181-0/+5
| | | | | | | | | | | | | | Before the patch we set the standard flags in two places: - once when building qtbase - and always when including QtSetup (for every repo that is built) This change makes sure to also set the correct standards flag when building standalone tests, because QtSetup is called to early in that case. Change-Id: Iad130b731e9eb9605bb91637364c33fdd49ce3cb Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* cmake: C++17 is mandatoryOlivier Goffart2020-02-181-5/+1
| | | | | Change-Id: Ia0f2151d38fec84be31afc76fc380666861d7d80 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix c++ standard config tests with MSVCAlexandru Croitor2020-02-183-0/+22
| | | | | | | | | | | | Need to pass additional -Zc:__cplusplus flag when using MSVC, so that the __cplusplus define has correct values. Additionally make the option be propagated to consumers of Qt via the public Platform target, which QtCore links against. Change-Id: Ie1283c25334b93f993529beb7fb32bdb001627f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-02-134-13/+184
|\ | | | | | | | | | | | | | | | | | | Conflicts: tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt Hopefully final merge from wip/cmake, and then all cmake changes should target dev directly. Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
| * Use INSTALL_DOCDIR when possibleChristophe Giboudeaux2020-02-121-10/+10
| | | | | | | | | | | | | | | | | | Hardcoding 'doc' causes issues when installing qtbase but also when trying to build the other modules documentation. Change-Id: I5c57852add59d0dc0d067813feea0bbb0962c84b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Add support for qt_helper_lib()Leander Beernaert2020-02-122-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qt_add_3rdparty_library() function as a replacement for qmake's qt_helper_lib feature. All 3rdparty libraries will be available under the Qt:: alias when built through this method so that they can properly register as dependencies of a Qt module. This patch also adds Qt3rdPartyLibraryConfig.cmake.in to export the CMake configuration for static builds and shared libraries. Change-Id: I52bf3a95ca22fccd9ab54343468847bb1b570c28 Fixes: QTBUG-81969 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Only export public module link dependencies for shared buildsLeander Beernaert2020-02-122-2/+11
| | | | | | | | | | | | | | | | | | Unless we are building under a static library configuration there is no reason to export the dependency on private libraries. Change-Id: I724da38495dc55cc2783d4b19c01533fc0900d22 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Fix typo for Mtdev pkgconfig targetSamuli Piippo2020-02-111-1/+1
| | | | | | | | | | | | Change-Id: Id6e7057e8010f67ba1c8ce948abc59bc7abf7b7b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | 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>