1 # PARAVIEW_QT_VERSION is used to choose between Qt5 and Qt6. 2 # If it is set to Auto(default), PARAVIEW finds and uses the 3 # version installed on the system. If both versions are 4 # found, Qt6 is preferred. 6 # Note that this is a duplication of vtkQt.cmake from VTK 8 set(paraview_supported_qt_versions
"Auto" 5 6)
10 # The following `
if` check can be removed once CMake 3.21 is required and
11 # the policy CMP0126 is
set to NEW
for ParaView and other superbuilds.
12 if (NOT DEFINED PARAVIEW_QT_VERSION)
13 set(PARAVIEW_QT_VERSION
"Auto" CACHE
14 STRING
"Expected Qt major version. Valid values are Auto, 5, 6.")
15 set_property(CACHE PARAVIEW_QT_VERSION PROPERTY STRINGS
"${paraview_supported_qt_versions}")
18 if (NOT PARAVIEW_QT_VERSION IN_LIST paraview_supported_qt_versions)
19 string(REPLACE ";" "\", \"" paraview_supported_qt_versions_string "${paraview_supported_qt_versions}
") 21 "Supported Qt versions are \
"${paraview_supported_qt_versions_string}\". " 22 "But `PARAVIEW_QT_VERSION` is set to \"${PARAVIEW_QT_VERSION}\".")
25 if (PARAVIEW_QT_VERSION STREQUAL "Auto")
26 find_package(Qt6 QUIET COMPONENTS Core)
27 set(_paraview_qt_version 6)
29 find_package(Qt5 QUIET COMPONENTS Core)
32 "Could not find a valid Qt installation.")
34 set(_paraview_qt_version 5)
37 set(_paraview_qt_version "${PARAVIEW_QT_VERSION}
") 40 set(PARAVIEW_QT_MAJOR_VERSION "${_paraview_qt_version}
")