From 98c89c8cc1c5ceb4bfbb5f5ed6c96ecdbab99afa Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 14 Dec 2021 16:56:39 +0100 Subject: CMake: Build examples as ExternalProjects in prefix builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jörg Bornemann --- cmake/QtSetup.cmake | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'cmake/QtSetup.cmake') 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) -- cgit v1.2.3