qt5base-lts/cmake/QtBuildInternals
Alexandru Croitor d1a17d9655 CMake: Fix reconfiguration when -no-opengl is specified
In a previous change, we ensured that all INPUT_foo cache variables are
unset at the end of configuration, so they don't influence feature
re-evaluation in case if a command line flag like -no-gui is not
specified upon second reconfiguration and a FEATURE_foo is manually
toggled in the CMakeCache.txt, effectively getting rid of
stale INPUT_foo values.

Unfortunately that causes an issue when configuring with -no-opengl
and then trying to reconfigure with 'cmake .'

Specifically various feature options like ENABLE / DISABLE use
INPUT_foo variables in their expressions.
qt_configure_add_report_entry CONDITIONs also use them.

These expect the INPUT_foo variables to be persisted, and if they are
removed, the expressions might be re-evaluated to a different value,
and cause re-configuration to fail or unexpectedly toggle features.

To support both cases described above, instead of removing all INPUT
variables when configuration ends, only unset those INPUT variables
whose corresponding FEATURE_foo variable has been manually toggled in
CMakeCache.txt or via an IDE.

Toggling a FEATURE_foo manually is intentional, which means the
INPUT_foo value should be discarded. Whereas pre-existing INPUT_bar
variables will persist, thus not breaking cases like the -no-opengl
report CONDITION.

Amends 2799391703

Pick-to: 6.6
Fixes: QTBUG-116973
Task-number: QTBUG-112957
Change-Id: I5851255bfa41a9a1d116630a5d9f7b9a74aa93ed
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-09-13 20:09:19 +02:00
..
QtStandaloneTestTemplateProject CMake: Don't set QT_BUILDING_QT for single standalone tests 2023-07-12 18:38:31 +00:00
QtBuildInternalsConfig.cmake CMake: Fix reconfiguration when -no-opengl is specified 2023-09-13 20:09:19 +02:00