summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix libraries in qt_lib_XXX_private.pri files for NMCJoerg Bornemann2020-06-093-31/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | qmake_use.prf understands the _DEBUG and _RELEASE suffixes for QMAKE_LIBS_XXX entries. The CMake configuration "Debug" is considered for the _DEBUG entries, "Release" and "RelWithDebInfo" for _RELEASE. The qt_lib_XXX_private.pri files are now generated in multiple steps: 1. The QT_LIBS_XXX information is generated per $<CONFIG> and written to .cmake files. 2. A preliminary qt_lib_XXX_private.pri file is generated, containing only configuration-independent data. 3. A custom command runs the QtGenerateLibPri.cmake script that combines the files from step 1 and 2 into the final qt_lib_XXX_private.pri file. The same is done for mkspecs/qmodule.pri. To be able to trigger custom commands from header modules, which are interface libraries, we introduce one XXX_timestamp ALL target per header module that creates a timestamp file. To that XXX_timestamp target we add the pri file generation target as dependency. Fixes: QTBUG-84348 Change-Id: I610f279e37feeb7eceb9ef20b3ddfecff8cfbf81 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix qt_lib_XXX_private.pri generation for internal modulesJoerg Bornemann2020-06-091-15/+19
| | | | | | | | | The module pri files of internal modules did not expose any include paths. They must have both, the public and the private include paths. Task-number: QTBUG-84781 Change-Id: I3cbe94d4e49c754e49d26b00012e668b0afbdc8f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix failing plugin tests on MinGWAlexandru Croitor2020-06-091-0/+4
| | | | | | | | | | | MinGW plugins should not have the lib prefix in the shared library names. Do this manually for a couple of libraries, and also for the generic qt_add_cmake_library function. Amends 9b0e23ef8a915a8c58808fa356f771ecdb6f020c Change-Id: I1cfaf8fc046f86edd3e755adfa599aa0aa854ee3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Save OPENSSL_ROOT_DIR in QtBuildInternalsExtraAlexandru Croitor2020-06-081-0/+10
| | | | | | | | | | | This is needed so that other repos other than qtbase (like qtopcua) can still find_package(WrapOpenSSL) successfully. The path needs to be converted to a CMake path, to avoid issues on Windows with backslashes. Change-Id: I3d7652d93110f6b8f39a58a6c28aef6c7471aea7 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Don't reset install prefix upon standalone test reconfigurationAlexandru Croitor2020-06-081-12/+4
| | | | | | | | | | | | | | | | | | | | CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT might be empty on the first configuration, but because QtBuildInternalsExtra sets the CMAKE_INSTALL_PREFIX, a second reconfiguration of a test would stop setting the fake install prefix. After some further consideration, there's no need to set the local fake prefix conditionally, we can always do it (unless explicitly opted out). This makes sure that a reconfiguration of a test doesn't suddenly install into the Qt prefix again. Amends 37b132cd4e081821ddc261d24abe8f914123547a Task-number: QTBUG-84346 Change-Id: Ic61aefe18418658455d8cdb9ebe6bcbcb8d67c99 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Do not create Qt6ToolsConfig[Version].cmake filesJoerg Bornemann2020-06-082-54/+0
| | | | | | | | They are not necessary, and they conflict with what qttools generates. Fixes: QTBUG-82133 Change-Id: I4a1273d694626345b32b45c653dd31d3b78621eb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: quote paths to prevent issues when no install prefix is setJean-Michaël Celerier2020-06-051-1/+1
| | | | | Change-Id: Ifa7f1ef70c4893e10cb4ce9a54d8a0806d19be93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Clean up AND NOT QT_BUILD_STANDALONE_TESTS in QtAutoDetectAlexandru Croitor2020-06-041-3/+2
| | | | | | | | Now that the whole file is not included when doing standalone tests, the conditions are not needed anymore. Change-Id: I49ddd2fc4a8327e09529948785f40cda5dedbb11 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Protect against Qt toolchain file recursive inclusionAlexandru Croitor2020-06-043-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Three different people have encountered the issue that calling calling qt-cmake on a project prints 1000 inclusion lines of the same qt toolchain file, and then CMake bails out saying can't find the CMAKE_MAKE_PROGRAM Ninja. This happened because people accidentally called qt-cmake to configure qtbase (instead of just cmake), which created a toolchain file that chainloads itself recursively. Error out when configuring qtbase, and when using the generated toolchain file in the case when it would try to include itself. The solution is to remove the qtbase CMakeCache.txt file, and configure qtbase again, so it generates a proper qt.toolchain.cmake file. If somebody feels enthusiastic, they can move the check into the qt-cmake and qt-cmake-private shell scripts, and error out before the qtbase/CMakeCache.txt is polluted with the wrong toolchain file. That is left for people that feel more comfortable with bash and batch scripting. Change-Id: If518c94791fe7c30731e6e462e347f26a5213c64 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix qmake mixing for framework buildsAlexandru Croitor2020-06-042-6/+23
| | | | | | | | | | | | | Include headers in .pri files should point to the framework Headers dirs. The module name in the .pri file is not versioned when it's a bundle. Paths to system frameworks in .prl files should instead be replaced with -framework Foo flags. Change-Id: Ia353d033799fae40a1bc55fad6f86b2c8ef76c56 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix double-conversion usage on macOSAlexandru Croitor2020-06-041-37/+3
| | | | | | | | | | | | | | | | | | We reported that double-conversion was found on macOS if the std library supported sscanf_l and _snprintf_l, but that's different from what qmake does. This caused not to compile and link the bundled double-conversion sources, and caused tst_qvariant to fail when doing double conversions on macOS. Remove the extra config tests, and make it work like in qmake, so that the bundled code is used instead. This makes tst_qvariant pass. Amends 729a73a9cfe774cb49251be8c99ba5b26d516e01 Change-Id: I7ddaed5fe6916f483fb3de1962657d7fb6fb40be Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix standalone tests to work properly on reconfigurationAlexandru Croitor2020-06-043-17/+33
| | | | | | | | | | | | | | | | | And also fix qt-cmake-standalone-test to work for prefix builds. The gist of it is that we have to protect tests not to be installed into the Qt install prefix, but we also have to make sure that the CMAKE_INSTALL_PREFIX is not changed globally (via cache value), so that reconfiguration still works. This took way too long to figure out. Amends d6272d774c7415186aa398e59f234d0073458072 Fixes: QTBUG-84346 Change-Id: I18c29574c9957fe05b86f701c8c14ec07e0f045b Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix tst_foo_check to work for qml tests as wellAlexandru Croitor2020-06-031-6/+10
| | | | | | | | | | | | | | | Qml tests currently don't expose a CMake target, so no dependency should be added to a non-existent target. Make sure to add the check target only if the test was previously added. Fixes configurtion failure of qtdeclarative tests. Amends 873aa682c56b1c187e2c87b49050509db9d1b16b Change-Id: Ic8bbfe668c00c1ce05f1e1dfe5494dafd91dd7b8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Make it possible to build tools when cross-compilingLeander Beernaert2020-06-024-23/+108
| | | | | | | | | | | | | | | | | | | This patch allows tools to be built for the target platform when the QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration time. To avoid naming conflicts, the target tools are suffixed with "_native". The qt_get_tool_target_name() function can be used to get the tool name for both scenarios (cross and non-cross compilation). Extend pro2cmake to refer to the right target name for tools. The relevant write_XXX functions have a new target_ref parameter that will be "${target_name}" for tools and literally the target name for everything else. Fixes: QTBUG-81901 Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add ${tst_foo}_check target for easy test runningAlexandru Croitor2020-06-021-0/+8
| | | | | | | | Given a test named "tst_qdrag", you can run "ninja tst_qdrag_check" to build and run the test. Change-Id: I47dccb39dd60fca9cb07ff9af9fb739b293c5aaf Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow module names starting with digitsMike Krus2020-05-311-2/+2
| | | | | | | This was allowed with QMake. Change-Id: Ia3052cd2086d633a343cfe59afddded2f79fc551 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Quote the arguments to CMD's 'set' commandMårten Nordheim2020-05-291-1/+1
| | | | | | | This avoids issues with some special characters and spaces. Change-Id: I6b7cedbe2c9663f62fae104488454faebab52ce0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake Build: Do not set "lib" prefix for modules (plugins)Cristian Adam2020-05-291-0/+4
| | | | | | | CMake sets "lib" as default prefix for Windows-GNU platforms. Change-Id: I49e3123c385610307c84c584a21f5f3827a6fafd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake Build: Rename cmake_command to cmake_languageCristian Adam2020-05-281-1/+1
| | | | | | | The function name has been changed upstream (3.18). Change-Id: I76a26cdc8de71dffa5402a7c7423006a7a01552e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Tidy up qt_get_direct_module_dependenciesAlexandru Croitor2020-05-281-16/+9
| | | | | | | | | | | | It's only calls were with the PUBLIC argument, so remove the argument both in the declaration and call sites, and just return the public dependencies. Fix up the names of the variables as well. Amends b56dc55c3a5c4164ad84fd61c44638a3cb196978 Change-Id: I830c1894376d0d3a2eb2bd4ffa38a1b3b3066292 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix qmake .depends info generated for module_private.pri filesAlexandru Croitor2020-05-282-7/+14
| | | | | | | | | | | | | | | | | | | | | | | Previously we checked the LINK_LIBRARIES property of the main module target, but we should instead use the values of INTERFACE_LINK_LIBRARIES set on the FooPrivate module. Because both versionless targets and private targets are interface libraries, we need to properly differentiate between them when following versionless targets to their main associated target. To do that, instead of using string comparison, export an additional private _qt_is_versionless_target property, and query that. Also make sure to set and export the _qt_config_module_name property on the FooPrivate targets. Also make sure to APPEND to EXPORT_PROPERTIES rather than override (looking at you QtFeature.cmake). Task-number: QTBUG-75666 Change-Id: Ia3261e218840e9f5217ab49755e8c876560e294d Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Use -fapplication-extension when building Qt libraries on macOSAlexandru Croitor2020-05-281-0/+19
| | | | | | | | | | | | | | | | | Needed to avoid linker warnings transformed into errors, when linking QtWebEngine with qmake mixing. ld: warning: linking against a dylib which is not safe for use in application extensions: The flag is added to libraries and plugins, unless opted out. CMake equivalent of 944110089d4cb1c229dba422989e154db65a67fd Task-number: QTBUG-83929 Task-number: QTBUG-75666 Change-Id: I3e9acca4712c9a266bf54c6e35e2fd2c0096692b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Write QT.XXX.depends entries into module pri filesJoerg Bornemann2020-05-251-7/+66
| | | | | | | | | | | | | | | | | Qt module targets now export the "_qt_config_module_name" property, which contains the module's name in qmake land. This can be different from the lower case target name (e.g. Test vs testlib). This exported property is used when retrieving the dependencies of a module outside of qtbase. The property's name is a bit odd and lower case, because we want to be able to set it on INTERFACE_LIBRARY targets, for instance header modules. This CMake pecularity is described in https://gitlab.kitware.com/cmake/cmake/issues/19261 Fixes: QTBUG-84287 Change-Id: I4a75af3ebeabebc56a0f77d464e45ab7fd81eafa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "CMake: Don't create *Depends header for header-only modules"Joerg Bornemann2020-05-202-9/+3
| | | | | | | | | | | | This reverts commit e875f458055d6a7b54d2d853590ccc2495ab145b. Reason for revert: syncqt creates a master header that includes the *Depends header. Therefore we must always create the *Depends header. Ignore for now that *Depends headers are empty and pointless for module headers. Change-Id: I1dcc836788b3d46c4f1b504d2d64e9eb67b66206 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Hot fix for Ninja Multi-Config with MSVC and OpenSSLJoerg Bornemann2020-05-201-1/+6
| | | | | | | | | | | For now, we have to turn off the 3rdparty lib generation code for qt_lib_XXX.pri files, because it's broken for NMC if the 3rdparty libraries have different binaries per config. The actual fix is more involved. Task-number: QTBUG-84348 Change-Id: I863e69085b68c0dbbb3f6c415111bc255799e155 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Move qt_lib_XXX.pri generation to module finalizerJoerg Bornemann2020-05-201-18/+21
| | | | | | | | | | | | Introduce a qt_finalize_module function that is called as a CMakeLists.txt finalizer and call qt_generate_module_pri from there. This is done in preparation for writing the QT.XXX.depends entries to the module pri files, because we must do this after all dependencies have been added. Change-Id: Ia61db73383541651389fd647523ef535792874d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Use provided OUTPUT_DIRECTORY for manual tests and benchmarksAlexandru Croitor2020-05-191-2/+10
| | | | | | | | If an OUTPUT_DIRECTORY option is provided, it should be used instead of discarding it. Change-Id: Ie53b56616f16589f7c05ff9378d7ba2e2ba34726 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Append to QT_CONFIG in the qt_lib_XXX.pri filesJoerg Bornemann2020-05-191-0/+1
| | | | | | | | The module pri files are supposed to add their public features to the global QT_CONFIG variable. Change-Id: I9a1719f897747a1d89011b1f1231c05a23539def Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix reading of INTERFACE_* properties in pri file generationJoerg Bornemann2020-05-191-1/+1
| | | | | Change-Id: I3d1b1910239ada44d393f8c2c8803f33f7b64189 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix calling finalizers with empty argumentsJoerg Bornemann2020-05-191-1/+1
| | | | | Change-Id: I7a826a4cd5e38882932476ef31cdb949cc1949c8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix empty plugin_types value in module pri filesJoerg Bornemann2020-05-191-1/+5
| | | | | | | Avoid writing module_plugin_types-NOTFOUND into the module .pri files. Change-Id: I2fed7b0d1c21e2233eebcaca419f522a07d22af4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate qt_plugin_XXX.pri filesJoerg Bornemann2020-05-191-3/+54
| | | | | | Task-number: QTBUG-75666 Change-Id: I4ea0679fa0c62a486d03568525ad60697709fe68 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate information about 3rdparty libs in module .pri filesJoerg Bornemann2020-05-193-3/+198
| | | | | | | | | | | | | For modules that are not yet ported to CMake and that use QMAKE_USE += libfoo we need to provide the information about libfoo in the qt_lib_XXX.pri files. Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs. Task-number: QTBUG-75666 Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Use custom install script to support Ninja Multi-Config buildsAlexandru Croitor2020-05-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Calling cmake --install . only installs a single configuration. To install both debug and release artifacts, the install invocation needs to be done for each configuration. To keep the Coin instruction code simpler, delegate the looping over configurations to a custom CMake script, and use it in the Coin instructions. Replace all cmake --install calls in the instructions with calls to either call_host_install.yaml or call_target_install.yaml. The path to the script depends on whether we are building qtbase or another module. In the former case the script should be called from the build dir, otherwise from the install dir. The other distinction is whether the host or target env prefix needs to be added. Task-number: QTBUG-80900 Change-Id: Ied4bf739e2b1a2307f22fc79c1cfad746c8cbc44 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Install non-main-config tools and executables to a subdirAlexandru Croitor2020-05-191-25/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Ninja Multi-Config, we don't want to install a "Release" moc.exe, and then override it with a "Debug" moc.exe. Because it doesn't seem possible to exclude installation of targets per configuration, put the non-main configuration tools into configuration specific subfolders like "bin/Debug", so no overriding happens upon installation. Introduce a new function qt_get_install_target_default_args() which returns install destination arguments for consumption in qt_install() calls. The function adds the config-specific suffix to the destination for the appropriate configs. Each call to qt_install *adds* new rules for installation, which means that export registration needs to happen only on the first call. Make sure qt_add_tool doesn't ask qt_add_executable to install yet again, to create duplicate rules. Apply the same install arguments logic to qt_add_executable calls. Task-number: QTBUG-80900 Task-number: QTBUG-80901 Change-Id: I3e732d27dba5bf5f8059d2878ef1e425237d383a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Default to building all configurations with Ninja Multi-ConfigAlexandru Croitor2020-05-192-1/+11
| | | | | | | | | | Thus we will build both Release and Debug configurations in Coin when cmake --build . is executed, mimicking qmake's make which builds both configurations in debug_and_release. Task-number: QTBUG-80900 Change-Id: If48aca249eb84e690d3f9d51a733b3a25df1f7ca Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Allow using single config generators after building with NMCAlexandru Croitor2020-05-191-9/+46
| | | | | | | | | | | | | | | | | | | | | | | | Where NMC is the CMake Ninja Multi-Config generator. The first use case is to allow building standalone tests with one configuration even if Qt was build with multiple configurations. Another use case is for regular Qt consumers that might use the generated qt-cmake shell script which does not have the generator specified (as opposed to qt-cmake-private). Another detail is to use the first configuration from the initial Qt configurations list (CMAKE_CONFIGURATION_TYPES) when building standalone tests with a single config generator, so that it doesn't default to Debug, but rather to the provided first configuration. This matches qmake behavior, where on Windows with a debug_and_release configuration, tests are still built against release. Task-number: QTBUG-80900 Change-Id: I0da91c1f91095332cfe9e38d17f440aad6a09d15 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't create *Depends header for header-only modulesJoerg Bornemann2020-05-162-3/+9
| | | | | | | | | Set the target property INTERFACE_MODULE_IS_HEADER_ONLY for header-only modules, and only create *Depends header files if this property is falsy. Change-Id: Ic6b100787d18b3ff1f7b9d0f2b5c744018b1f295 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add MODULE_INCLUDE_NAME one-value-keyword to qt_add_moduleJoerg Bornemann2020-05-152-10/+17
| | | | | | | | | | | | This value is the equivalent of qt_module.prf's MODULE_INCNAME and can be used to specify a name for the module's include subdirectory. The default is Qt<ModuleName>. The include name is stored in the module's target property MODULE_INCLUDE_NAME. Change-Id: Ie6c8f6882ee2c3db78884ae5781593c803be3c05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Enable default usage of utf8 sources for Qt consumersAlexandru Croitor2020-05-153-1/+20
| | | | | | | | | | And enable the same default when building Qt itself (it's implicit). Allow opting out on a target-by-target basis, by using the public qt_disable_utf8_sources() API call. Change-Id: Ifc19a744d57b96b1c74a6926a0c6628c2a820464 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Set QT_TARGET_XXX properties for Qt executables and pluginsJoerg Bornemann2020-05-121-10/+44
| | | | | | | | | | | | | Before, we were setting those properties only for Qt modules. Now, Qt executables and plugins have a full VERSIONINFORMATION resource on Windows. Also, extend the CMake API with the possibility to pass target information to modules, plugins and tools. This will be used in a subsequent commit. Change-Id: I2bb8d3637569e0eaec76f56331bc23282285d872 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make build system of installed Qt more relocatableAlexandru Croitor2020-05-078-99/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aka handle CMAKE_INSTALL_PREFIX in a more relocatable way. The following story inspired this change. If a user wants to build a Qt repo into a different install prefix than the usual Qt one, this will fail configuration because we look for various things like syncqt, qdoc, etc relative to CMAKE_INSTALL_PREFIX, which will now point to a different location where none of the above tools are located. The intent for such a use case is to support building Qt packages with Conan, which sets a random install prefix when configuring a repo. The idea is to derive the qt prefix dynamically from the QtBuildInternals package location. Essentially it's a reverse relative path from the QtBuildInternalsConfig.cmake file to the install prefix that was specified when initially configuring qtbase. Once the dynamic prefix is computed (so we know where the possibly relocated Qt is), we can find tools like syncqt and qdoc. This is an initial attempt to support a use case like that. More design work will probably needed in case if tools / libs need to be found in a location different than the Qt install prefix (so support for multiple install prefixes / search paths). An example of such a case would be when building qtdeclarative and qtquickcontrols2 as Conan packages in one go. Most likely the qmltyperegistrar tool will be located in the random install prefix set by Conan, so building qtquickcontrols2 might fail due to not finding the tool in the original Qt install prefix. As to the implementation details, the change does the following: - Dynamically computes and sets the QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable when find_package()'ing QtBuildInternals. It's an absolute path pointing to where the relocated Qt is. - When building qtbase this variable is not yet available (due to QtBuildInternalsExtra not existing), in that case we set the variable to the absolute path of CMAKE_INSTALL_PREFIX (but only for the initial qtbase configuration). - Remove QT_BUILD_INTERNALS_ORIGINAL_INSTALL_PREFIX which was used for standalone tests purposes. It's not needed now that we compute the location of the Qt prefix dynamically. - The Unixy qt-cmake and qt-cmake-private shell scripts now use a relative path to find the toolchain file we created. - The toolchain file also dynamically computes the location of the Qt packages, and adds them to CMAKE_PREFIX_PATH. - A lot of existing CMAKE_INSTALL_PREFIX uses are replaced with QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX. This includes finding tool locations, mkspecs dir, path environment setup for tools, etc. - Some places still use CMAKE_PREFIX_PATH in the following cases - When determining paths while configuring qtbase (valid cases) - When I wasn't sure what the behavior should be, so I left them as-is (an example is documentation generation, do we want to install it into the random Conan prefix, or into the main prefix? Currently it installs in the random prefix). Note that relocating a Qt installation does not work for non-prefix / non-installed builds, due to hardcoded paths to include directories and libraries in generated FooTargets.cmake files. Task-number: QTBUG-83999 Change-Id: I87d6558729db93121b1715771034b03ce3295923 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Replace hardcoded include dirs for the global qtbase targetsAlexandru Croitor2020-05-071-8/+8
| | | | | | Change-Id: I22a120a0cb8ca690d224b1301b85e704364fbce0 Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix typo in readmePaul Wicking2020-05-041-1/+1
| | | | | Change-Id: I6066eb5309ff7e6e4e6fd1b8dff65957be6d5a55 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Write QT.XXX.plugin_types to qt_lib_XXX.pri filesJoerg Bornemann2020-05-011-0/+8
| | | | | | | | | This is needed for building Qt plugins with qmake against other CMake-built modules. Change-Id: Ibd6ad0b08645c798be74285b24f71add947bea88 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add some missing MinGW definesAlexandru Croitor2020-05-011-1/+1
| | | | | | | Task-number: QTBUG-83929 Change-Id: Iaa12f1f8652cb132bead91160a2898657de52edb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* CMake: Limit warnings_are_errors flags to C++ and Objective-C++Alexandru Croitor2020-05-011-2/+9
| | | | | | | | Otherwise when applied to bundled 3rd party library C files, the MinGW build fails when compiling src/3rdparty/md4c/md4c.c. Change-Id: Ia522b10aa69aa15f239d20c65e31c84edbccee6d Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* CMake: Fix failing standalone tests on WindowsAlexandru Croitor2020-05-012-4/+29
| | | | | | | | | | | | | | | Due to the install prefix being changed for standalone tests, the correct $qt_prefix/bin folder was not added to the PATH environment variable when running tests. Make sure to always include the the original qt install prefix, even if a different install prefix is specified when configuring standalone tests. Amends 39090ea15c41eded8a233ec2633c0c657280297c Change-Id: I22aab732bb2bb679074a811d28d8209e1d535df3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use NAME_MISMATCHED in find_package_handle_standard_args of ECMAlexandru Croitor2020-05-011-0/+5
| | | | | | | | | Gets rid of mismatch warnings when looking for various ECM packages like XCB. Change-Id: I0bf4db993195993df7789c032454b7883e8efd35 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Fix 32 bit Qt builds like our MinGW config in CoinAlexandru Croitor2020-05-011-0/+49
| | | | | | | | | | | | | | Enable sse2 and fpmath for modules when appropriate, the logic is a port of the code in mkspecs/features/qt_module.prf. Fix qdrawhelper.cpp to always be compiled when using GCC with a special case. pro2cmake.py failed to handle the source subtraction correctly. Fixes: QTBUG-83791 Task-number: QTBUG-75578 Change-Id: Ibe32a250b266d580ad21f6c55f09fd03a14ceb82 Reviewed-by: Simon Hausmann <hausmann@gmail.com>