Skip to content

Commit 0ed6fda

Browse files
authored
Use same QT vesion as VTK. (#6406)
* Use same QT vesion as VTK. * Move the setting of WITH_QT to AUTO to else block, if VTK is not used/found.
1 parent 498bc93 commit 0ed6fda

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,19 @@ if(WITH_VTK)
423423
endif()
424424
endif()
425425

426-
# 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.
427-
set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)")
426+
# If VTK has found a Qt version, default to the same version
427+
if(VTK_QT_VERSION STREQUAL "5")
428+
message(STATUS "VTK has found Qt5 - defaulting to same version.")
429+
set(WITH_QT "QT5" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)")
430+
elseif(VTK_QT_VERSION STREQUAL "6")
431+
message(STATUS "VTK has found Qt6 - defaulting to same version.")
432+
set(WITH_QT "QT6" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)")
433+
else()
434+
# 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.
435+
set(WITH_QT "AUTO" CACHE STRING "Build QT Front-End (AUTO|YES|QT6|QT5|NO)")
436+
endif()
428437
set_property(CACHE WITH_QT PROPERTY STRINGS "AUTO" "YES" "QT6" "QT5" "NO")
438+
429439
if(WITH_QT)
430440
include("${PCL_SOURCE_DIR}/cmake/pcl_find_qt.cmake")
431441
endif()

0 commit comments

Comments
 (0)