From 37452051d6b68f20a52c65cffd3cde5cb323156e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 8 Jan 2021 16:36:36 +0100 Subject: [PATCH] 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 --- cmake/QtProcessConfigureArgs.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 07ac50e000e..70dd5b92e3f 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -185,6 +185,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