File: vtkQt.cmake

package info (click to toggle)
paraview 5.11.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 497,236 kB
  • sloc: cpp: 3,171,290; ansic: 1,315,072; python: 134,290; xml: 103,324; sql: 65,887; sh: 5,286; javascript: 4,901; yacc: 4,383; java: 3,977; perl: 2,363; lex: 1,909; f90: 1,255; objc: 143; makefile: 119; tcl: 59; pascal: 50; fortran: 29
file content (36 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# VTK_QT_VERSION is used to choose between Qt5 and Qt6.
# If it is set to Auto(default), VTK finds and uses the
# version installed on the system. If both versions are
# found, Qt6 is preferred.

set(vtk_supported_qt_versions "Auto" 5 6)

# The following `if` check can be removed once CMake 3.21 is required and
# the policy CMP0126 is set to NEW for ParaView and other superbuilds.
if (NOT DEFINED VTK_QT_VERSION)
  set(VTK_QT_VERSION "Auto" CACHE
    STRING "Expected Qt major version. Valid values are Auto, 5, 6.")
  set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS "${vtk_supported_qt_versions}")
endif()

if (NOT VTK_QT_VERSION STREQUAL "Auto")
  if (NOT VTK_QT_VERSION IN_LIST vtk_supported_qt_versions)
    message(FATAL_ERROR
      "Supported Qt versions are \"${vtk_supported_qt_versions}\". But "
      "VTK_QT_VERSION is set to ${VTK_QT_VERSION}.")
  endif ()
  set(_vtk_qt_version "${VTK_QT_VERSION}")
else ()
  find_package(Qt6 QUIET COMPONENTS Core)
  set(_vtk_qt_version 6)
  if (NOT Qt6_FOUND)
    find_package(Qt5 QUIET COMPONENTS Core)
    if (NOT Qt5_FOUND)
      message(FATAL_ERROR
        "Could not find a valid Qt installation.")
    endif ()
    set(_vtk_qt_version 5)
  endif ()
endif ()
set(vtk_qt_major_version "${_vtk_qt_version}" CACHE INTERNAL
  "Major version number for the Qt installation used.")