summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2025-12-01 09:59:16 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2025-12-01 18:19:30 +0100
commitc61d900303c20750d67498b646e095669a890374 (patch)
tree7ce64d6a08f0598d6fc72de12f8d2db9e09c467c /src
parentd6549f4781ea7d0023cf5b1b47d5b7f3139c9e0e (diff)
CMake: Replace qt_set01 with explicit if() conditions
The qt_set01 function had a critical argument quoting flaw. This happened because CMake removes quotes when calling the function, causing variable substitution in the condition evaluation. For example, calling qt_set01(QNX CMAKE_SYSTEM_NAME STREQUAL "QNX") with QNX already set to 1 would evaluate CMAKE_SYSTEM_NAME STREQUAL QNX (where QNX expands to 1) instead of CMAKE_SYSTEM_NAME STREQUAL "QNX". This particularly affected users with QNX toolchains that pre-set the QNX variable, causing configure to fail. Replace all qt_set01 calls with explicit if/else blocks that properly preserve string literals and avoid the eval-like behavior. Remove the qt_set01 function. The platform detection code is now admittedly more verbose but plain CMake without argument quoting pitfalls. Pick-to: 6.8 6.10 Fixes: QTBUG-142267 Change-Id: I642fc8582001b8c7b7b6ff56eae7ccabc89ba565 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/configure.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake
index b14f7e74ad2..e34f4d8b30a 100644
--- a/src/gui/configure.cmake
+++ b/src/gui/configure.cmake
@@ -28,8 +28,11 @@ set_property(CACHE INPUT_libpng PROPERTY STRINGS undefined no qt system)
#### Libraries
-qt_set01(X11_SUPPORTED LINUX OR HPUX OR FREEBSD OR NETBSD OR OPENBSD OR SOLARIS OR
- HURD)
+if(LINUX OR HPUX OR FREEBSD OR NETBSD OR OPENBSD OR SOLARIS OR HURD)
+ set(X11_SUPPORTED 1)
+else()
+ set(X11_SUPPORTED 0)
+endif()
qt_feature_vcpkg_scope(gui)
qt_find_package(ATSPI2 MODULE PROVIDED_TARGETS PkgConfig::ATSPI2 MODULE_NAME gui QMAKE_LIB atspi)
qt_find_package(DirectFB PROVIDED_TARGETS PkgConfig::DirectFB MODULE_NAME gui QMAKE_LIB directfb)