summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-01-08 16:36:36 +0100
committerKai Koehne <kai.koehne@qt.io>2021-06-01 18:31:30 +0000
commitc83d3da1f182cfc304c14e85b7910d6b26958d45 (patch)
tree288e55aff39e50e8b0c66cc758e6f59f8c96eeeb
parent96d5539b8672f0e60d10d5cd41edf872cb447990 (diff)
Add QT_CONFIGURE_RUNNING variable for configure.cmake files
configure.cmake files are read twice when using the configure script / qt-configure-module: First, when configure is running and a second time, when CMake creates the local build system files. In the first run, not every function and esp. no targets are available. Code in configure.cmake that accesses targets or calls functions unknown to configure will fail at the configure stage. This patch introduces the QT_CONFIGURE_RUNNING variable that can be used in configure.cmake files to guard such code: if(QT_CONFIGURE_RUNNING) set(_qt_coord_type double) else() get_property(_qt_coord_type TARGET Qt6::Core PROPERTY INTERFACE_QT_COORD_TYPE) endif() Change-Id: Iff39924d6a5133379d28c8204d7b7afdf47de5c8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 37452051d6b68f20a52c65cffd3cde5cb323156e) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtProcessConfigureArgs.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 5ac3944d4a..73e138d1e8 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -186,6 +186,10 @@ function(qt_commandline_assignment var internal_var)
set(commandline_nr_of_assignments ${n} PARENT_SCOPE)
endfunction()
+# Check the following variable in configure.cmake files to guard code that is not covered by the
+# stub functions above.
+set(QT_CONFIGURE_RUNNING ON)
+
####################################################################################################
# Load qt_cmdline.cmake files