From 5c3c2d7d3834e6076e8a1fbd313a6e23663ea5cc Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Thu, 5 Feb 2026 09:51:41 +0100 Subject: [PATCH 1/2] Use same QT vesion as VTK. --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d887e5fb19..ea0c4e34fb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -423,6 +423,15 @@ if(WITH_VTK) endif() endif() +# If VTK has found a Qt version, default to the same version +if(VTK_QT_VERSION STREQUAL "5") + message(STATUS "VTK has found Qt5 - defaulting to same version.") + set(WITH_QT "QT5" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") +elseif(VTK_QT_VERSION STREQUAL "6") + message(STATUS "VTK has found Qt6 - defaulting to same version.") + set(WITH_QT "QT6" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") +endif() + # VTK can depend on Qt and search for its required version, so search after so we can overwrite Qt5_FOUND/Qt6_FOUND if the version we require is not found. set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") set_property(CACHE WITH_QT PROPERTY STRINGS "AUTO" "YES" "QT6" "QT5" "NO") From 6042a615695a326ee745dedb51851deb60547ed4 Mon Sep 17 00:00:00 2001 From: Lars Glud Date: Thu, 5 Feb 2026 09:51:59 +0100 Subject: [PATCH 2/2] Move the setting of WITH_QT to AUTO to else block, if VTK is not used/found. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea0c4e34fb2..168c3aba1ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,11 +430,12 @@ if(VTK_QT_VERSION STREQUAL "5") elseif(VTK_QT_VERSION STREQUAL "6") message(STATUS "VTK has found Qt6 - defaulting to same version.") set(WITH_QT "QT6" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") +else() + # VTK can depend on Qt and search for its required version, so search after so we can overwrite Qt5_FOUND/Qt6_FOUND if the version we require is not found. + set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") endif() - -# VTK can depend on Qt and search for its required version, so search after so we can overwrite Qt5_FOUND/Qt6_FOUND if the version we require is not found. -set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)") set_property(CACHE WITH_QT PROPERTY STRINGS "AUTO" "YES" "QT6" "QT5" "NO") + if(WITH_QT) include("${PCL_SOURCE_DIR}/cmake/pcl_find_qt.cmake") endif()