summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInformation.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Ensure top-level builds are affected by our chosen log levelAlexandru Croitor2022-06-101-0/+18
| | | | | | | | | | | This will hide the configuration summary and cmake feature summary and found packages output upon reconfiguration. Pick-to: 6.2 6.3 6.4 Task-number: QTBUG-104128 Change-Id: I42270b99e45076052ec176df4652661cae10ac0c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Show configuration summary on first configurationAlexandru Croitor2022-06-101-5/+38
| | | | | | | | | | | | | | | | | | | | | or when feature changes are detected, even when the log-level is set to NOTICE (which is the default for non-developer-builds). We want to show the summary during the first configuration so we don't force users to look into the config.summary file. We want not to show the summary upon reconfigurations, to keep regular reconfigurations as quiet as possibe, so it's easy to notice any new warnings. Amends e2a0ddbb69640c94b4ee107260a088d5c1c7e273 Amends 384dfceb532cada5f4be96430c8c7c866f40c933 Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104127 Change-Id: I506f33b4bae9da8957e04bb69c206bf00e3f7b0e Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Fix interleaved configure outputAlexandru Croitor2022-04-221-0/+5
| | | | | | | | | | | | | | | | | | | message(STATUS) prints output to a buffered stdout, whereas message(NOTICE) or just message() print to unbuffered stderr. We use a mix of message() calls when printing the configuration summary, which caused interleaved output. Because CMake offers no message(FLUSH), we work around the issue by calling execute_process(COMMAND -E echo " ") which does call std::cout << s << std::flush; We seem to have to do it twice, before and after the detailed configuration summary is printed. Pick-to: 6.2 6.3 Change-Id: Ibc075551fc0547073f0696477e54d9b9c1edca97 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Work around build rpath issue when CMAKE_STAGING_PREFIX is setAlexandru Croitor2022-04-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMake has logic to rewrite build rpaths that contain CMAKE_STAGING_PREFIX to instead point to CMAKE_INSTALL_PREFIX. This breaks running executables from the build directory, because their build rpath will point to a location where the libraries might not exist yet (we didn't install Qt yet). Work around this by setting CMAKE_STAGING_PREFIX to a fake path, so that CMake does not do the rewriting anymore. CMAKE_STAGING_PREFIX needs to be set at subdirectory scope, not function scope, which is why qt_internal_apply_staging_prefix_build_rpath_workaround() is a macro that is called from within each Qt internal function that creates a target. The workaround can be disabled by configuring with -DQT_NO_STAGING_PREFIX_BUILD_RPATH_WORKAROUND=ON The downside of this workaround is that it breaks per-subdirectory install rules like 'ninja src/gui/install'. Regular global installation like 'ninja install' works fine. This is similar to what we do for tests in qt_set_up_fake_standalone_tests_install_prefix() introduced by 20292250d44e08437306096e9096fc655cc9fb8b The reason it's not as good for other target types is because in contrast to tests, we do want to install them. In case if someone does call `ninja src/gui/install' they will most likely get a permission error, telling them it's not possible to install into /qt_fake_staging_prefix/ check_qt_internal_apply_staging_prefix_build_rpath_workaround Fixes: QTBUG-102592 Change-Id: I6ce78dde1924a8d830ef5c62808ff674c9639d65 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* configure: Add newline between configure summary and build instructionsTor Arne Vestbø2022-04-191-1/+1
| | | | | | | | | | | | | Otherwise we get: Styles ................................. Basic Fusion Imagine iOS Material Universal macOS Windows -- Qt is now configured for building. Just run 'cmake --build . --parallel' Pick-to: 6.2 6.3 Change-Id: Ie8d009455e4f45c9eb0557c4a08e9d0a94030c3a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix typo in configuration summary messageAlexandru Croitor2022-03-251-1/+1
| | | | | | | | Amends 384dfceb532cada5f4be96430c8c7c866f40c933 Pick-to: 6.2 6.3 Change-Id: Ica36551b64899848ab40e507ddf002af55b7db8c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Mention where the configure summary can be foundAlexandru Croitor2022-03-231-0/+9
| | | | | | | | | | | | | | | | | | when configuring for the first time. Also mention how to increase output verbosity. Unfortunately there is no way to check what is the current log verbosity to only show the latter message conditionally. Setting --log-level does not assign the same value to CMAKE_MESSAGE_LOG_LEVEL. Amends e2a0ddbb69640c94b4ee107260a088d5c1c7e273 Pick-to: 6.2 6.3 Change-Id: I22101b9dc7c407cc54aa5e7964dec50c7490f8f5 Reviewed-by: Dimitrios Apostolou <jimis@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Make configure less verbose by defaultAlexandru Croitor2022-03-041-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Only show the more verbose configure output when configuring with -developer-build (which matches --log-level=STATUS) Otherwise in a non-developer build, restrict the output to NOTICE+ message (includes WARNINGs and ERRORs). Developers can still pass a custom log level when configuring. For example -DCMAKE_MESSAGE_LOG_LEVEL=STATUS or --log-level=STATUS. The former method will be cached, while the latter is only applied to the current configure invocation. Also show the build instructions hint message only when configuring for the first time. [ChangeLog][CMake][configure] The configure output verbosity of non developer-builds of Qt is now reduced by default. Pass "-- --log-level=STATUS" to configure to make it verbose again. Pick-to: 6.2 6.3 Change-Id: I7583a9c92142e0b1d7c5411b06403f40d8ebaf20 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Fix minor grammar error in configure's closing messageEdward Welbourne2022-01-201-1/+1
| | | | | | | | | | | | | | | Minor glitch in wording, but it's been bugging me for months. The meaning of "try to remove [a file]" implicitly says you might be unable to do so; while the attempt might help with your situation, the experiment might merely be a diagnostic, e.g. because if you can't remove the file, that would imply things that would help you solve your problem. For contrast, "try removing [a file]" says removal might actually solve the problem for which this action is proposed as a fix. Change-Id: Ic995cfdef1523094bb368dcda8bd0d2bbd2e9434 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-2/+0
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: add support for Intel's LLVM-based compilerThiago Macieira2021-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes a few cleanups to our .cmake files where it was easier to combine existing sections of Clang / AppleClang that no longer needed to be distinct. icpx could be replaced with a shell script: exec `basename $0`/clang++ --intel "$@" tst_qnumeric is not passing FAIL! : tst_QNumeric::classifyF() Compared values are not the same Actual (qFpClassify(tiny / two)): 2 Expected (FP_SUBNORMAL) : 3 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)] FAIL! : tst_QNumeric::classifyD() Compared values are not the same Actual (qFpClassify(tiny / two)): 2 Expected (FP_SUBNORMAL) : 3 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(344)] FAIL! : tst_QNumeric::floatDistance(denormal) Compared values are not the same Actual (qFloatDistance(from, stop)): 0 Expected (expectedDistance) : 4194304 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)] FAIL! : tst_QNumeric::doubleDistance(denormal) Compared values are not the same Actual (qFloatDistance(from, stop)): 0 Expected (expectedDistance) : 2251799813685248 Loc: [/home/tjmaciei/src/qt/qt6-icx/qtbase/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp(408)] P Change-Id: Icb2516126f674e7b8bb3fffd16ad59431e8c3379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Include quiet packages in feature summaryAlexandru Croitor2021-08-181-1/+2
| | | | | | | | | | | | This will show packages that were found (or not) with find_package(QUIET) in summary just before the configure summary. It's useful for CI logs to determine whether some Qt packages was not found when cross-compiling. Pick-to: 6.2 Change-Id: Ic7d5062cf061f7c60b5c74374f957065dd8029f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Suggest "ninja install" for multi-config buildsJoerg Bornemann2021-08-171-0/+7
| | | | | | | | | | | The configure summary now suggests "ninja install" for Ninja Multi-Config builds, because "cmake --install ." does not install all configurations. See CMake upstream issue #21475. Pick-to: 6.2 Change-Id: Ie3129a906945db9d09c6772ce66ec7239797b8fc Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Report multi-arch targets in the configure summaryAllan Sandfeld Jensen2021-07-141-2/+7
| | | | | | | | Otherwise it will confusingly only list the host arch Pick-to: 6.2 Change-Id: Ic6d080f1fd9ebfa260ce7c35bd5e5b4ee686f083 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Extend qt_configure_add_summary_section by a message typeDominik Holland2021-03-091-0/+2
| | | | | | | | | | | With the existing types we can only display a list of features or whether a feature is on or off, but we cannot display arbitrary values. Using the new message type, it is possible to show paths or versions as summary entries. Change-Id: I5d16cb4b30923f3566755bd4d7440bdd1ece82f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix missed feature evaluation errors in reportAlexey Edelev2021-01-151-3/+9
| | | | | | | | | | | | Add an optional argument to store the report command while feature evaluation-only stage. This is necessary, because according to the actual feature evaluation process, evaluation happens only once and it's impossible to record any command during the evaluation-only stage. Fixes: QTBUG-90319 Change-Id: I215fbe0a28a2661cd2d97d253b2e2c787d295cbd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add newline to the end of the config.summaryAlexey Edelev2021-01-081-0/+1
| | | | | | | | Amends 94b6bec01f250065b28d5528ea9239bafd5253e5 Pick-to: 6.0 Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix missing report entriesAlexey Edelev2021-01-051-2/+2
| | | | | | | | | | Increment command_count correct way. Fixes: QTBUG-88054 Pick-to: 6.0 Change-Id: I0769814ed75ee12db1cab3b1f85635b4d7ee0605 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Print feature condition errors in configure reportAlexey Edelev2021-01-051-0/+5
| | | | | | | | | | | Add output of feature condition error at the end of configuration summary. Introduce qt_configure_add_report_error that may be used to add error to end-point configure report without actual configure interruption. Fixes: QTBUG-88282 Change-Id: Idcf478da863ae6507438eb3370927d7d1f01e071 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix dirty summary file when reconfigure qtAlexey Edelev2020-12-301-1/+2
| | | | | | | | | | | Overwrite summary file during each configuration cycle. Amends 6baf36d77432dc56a47e50f59ccde93b73cfe204 Fixes: QTBUG-87830 Pick-to: 6.0 Change-Id: Ie77f9aded4a7395592ff3cefad02265d836bebcc Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Revert "CMake: Fix missing report entries"Alexey Edelev2020-12-301-2/+1
| | | | | | | | | | This reverts commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c. Reason for revert: Issue when command_count is actually 0 Pick-to: 6.0 Change-Id: I1b2603f25b56e3bd50cfc22a08925930ad231498 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix missing report entriesAlexey Edelev2020-12-291-1/+2
| | | | | | | | | | Use LESS_EQUAL condition since qt_configure_command_count stores last added command index but not actual count Fixes: QTBUG-88054 Pick-to: 6.0 Change-Id: I8112820f9885bdad5a786a4f6b4890d8f2fbe14b Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Store config summary to fileAlexey Edelev2020-12-291-0/+5
| | | | | | | | | Add generation of qmake-like config.summary in build folder Fixes: QTBUG-87830 Pick-to: 6.0 Change-Id: I08dd9b3116c6200f7e9f5de96605118c1ea474ad Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Implement configure -list-featuresJoerg Bornemann2020-11-101-2/+21
| | | | | | | | | Extend qt_configure_get_padded_string to make the feature list look like qmake's. Fixes: QTBUG-88144 Change-Id: I714f2b2f3537b506365a03b5b6bc3413e9cab167 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix qt-configure-module location in configure's outputJoerg Bornemann2020-11-091-1/+6
| | | | | | | | | For non-cross-builds, qt-configure-module is located in CMAKE_INSTALL_PREFIX/bin, not below the staging prefix. Fixes: QTBUG-88262 Change-Id: Ib6cdd88ece391d5b8ce850b991564e5bed1e475d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Advertise qt-configure-module in configure outputJoerg Bornemann2020-10-221-1/+5
| | | | | | | | | ...instead of qt-cmake-private. Also, add ".bat" on Windows. Change-Id: I2aa94ac76f2dadfb8e94d68b19bb379b3d45a93d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Pad the configure summary string with one more dotAlexandru Croitor2020-10-221-1/+1
| | | | | | | | This makes the diff-ing of the config summary between qmake and CMake builds correct. Change-Id: I720b69572c23afd78e6d0bea6cdf0740980c3b36 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* cmake: Suggest qt-cmake-private script for building other Qt modulesKai Koehne2020-08-121-2/+2
| | | | | | | | This automatically sets the CMake Generator to be the same as the one used for qtbase. Change-Id: If9e1a6942520417393055c572f0d892efca43d2e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Add some air to configure summaryTor Arne Vestbø2020-07-261-4/+3
| | | | | Change-Id: I3408957d8a81ac3080eac28e48dbafe9059e22f5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix path to qt-cmake in configure summaryJoerg Bornemann2020-07-091-1/+1
| | | | | | | The path was wrong if CMAKE_STAGING_PREFIX was set. Change-Id: Iec90c7a5edf0da80a0ac108fe3411c340c01e9a9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix incorrect paths in build instructions messageAlexandru Croitor2020-06-111-4/+4
| | | | | | | | | | | | | When doing a top-level build, QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX is not set in the top-level scope. There's no point really in using the relocatable path anyway, given this will only be displayed once when either configuring qtbase or qt6. Just use CMAKE_INSTALL_PREFIX directly. Change-Id: Idb7e1953745f55048c42155868c2dd9384876c7c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Make build system of installed Qt more relocatableAlexandru Croitor2020-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Write QT_BUILD_PARTS to qmodule.priJoerg Bornemann2020-04-171-14/+1
| | | | | Change-Id: I4bddba38b51df3c70780d94f64a31b3040cb0bc8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Report which qt parts will be built by defaultAlexandru Croitor2020-04-021-0/+25
| | | | | | | | | Like libs, tools, examples, tests. Built by default means they are part of the default make / ninja target. Change-Id: I304e5724fc5dbd39626e9d589a6e1e92a4dd7882 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port most of the configure summary supportAlexandru Croitor2020-03-091-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | | Teaches configurejson2cmake about summaries / reports, so things like enabled features, configure sections, notes, etc. Add relevant CMake API for adding summary sections and entries, as well as configure reports. The commands record the passed data, and the data is later evaluated when the summary needs to be printed. This is needed, to ensure that all features are evaluated by the time the summary is printed. Some report and summary entries are not generated if they mention a feature that is explicitly exclduded by configurejson2cmake's feature mapping dictionary. This is to prevent CMake from failing at configure time when trying to evaluate an unknown feature. We should re-enable these in the future. A few custom report types are skipped by configurejson2cmake (like values of qmake CONFIG or buildParts). These will have to be addressed a case-by-case basis if still needed. Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Implement qtbase fixes for superbuildsJean-Michaël Celerier2020-01-081-0/+35
Change-Id: I0d3445cf0740e3925fa9342dac4d07892518afe5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>