summaryrefslogtreecommitdiffstats
path: root/cmake/QtSetup.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-12-14 16:56:39 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-02-01 16:51:01 +0100
commit98c89c8cc1c5ceb4bfbb5f5ed6c96ecdbab99afa (patch)
treec4ab5256149efa6eebe9dce4dda421d973023773 /cmake/QtSetup.cmake
parent1273ffb0002b14d952807c250dbcc6228f60ff26 (diff)
CMake: Build examples as ExternalProjects in prefix builds
Change prefix builds to use ExternalProjects to build examples by default. This will affect our CI which only does prefix builds. To make it work, we have to do a few adjustments: - look for Config files in the build-tree (before Qt is installed) - build only one examples with only a single config, even if Qt is a multi-config build - install examples as part of main make install step, rather than as part of the make step (which is the default for EPs) - adjust CXX flags when building with MSVC to ensure we can still use sccache and separate debug info - derive the correct install prefix for each example and pass it to the ExternalProject As a drive-by, add TODOs to address tidiness of the code and corner cases that likely don't work (Conan). Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I3060da5dc64e7b06052f9dcb720d4d250f876450 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtSetup.cmake')
-rw-r--r--cmake/QtSetup.cmake11
1 files changed, 1 insertions, 10 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 2a26878c0f..a8c9e63352 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -176,16 +176,7 @@ enable_testing()
option(QT_BUILD_EXAMPLES "Build Qt examples" OFF)
option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON)
-
-# FIXME: Support prefix builds as well QTBUG-96232
-if(QT_WILL_INSTALL)
- set(_qt_build_examples_as_external OFF)
-else()
- set(_qt_build_examples_as_external ON)
-endif()
-option(QT_BUILD_EXAMPLES_AS_EXTERNAL "Should examples be built as ExternalProjects."
- ${_qt_build_examples_as_external})
-unset(_qt_build_examples_as_external)
+option(QT_BUILD_EXAMPLES_AS_EXTERNAL "Should examples be built as ExternalProjects." ON)
option(QT_BUILD_MANUAL_TESTS "Build Qt manual tests" OFF)
option(QT_BUILD_MINIMAL_STATIC_TESTS "Build minimal subset of tests for static Qt builds" OFF)