File: itk-module-init.cmake

package info (click to toggle)
insighttoolkit5 5.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704,404 kB
  • sloc: cpp: 783,697; ansic: 628,724; xml: 44,704; fortran: 34,250; python: 22,874; sh: 4,078; pascal: 2,636; lisp: 2,158; makefile: 461; yacc: 328; asm: 205; perl: 203; lex: 146; tcl: 132; javascript: 98; csh: 81
file content (82 lines) | stat: -rw-r--r-- 2,277 bytes parent folder | download | duplicates (2)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Find the packages required by this module
#

# Needed VTK version
set(VERSION_MIN "8.1.0")

# Look for VTK
find_package(VTK NO_MODULE REQUIRED)

if(NOT COMMAND vtk_module_config)
  macro(vtk_module_config ns)
    foreach(arg ${ARGN})
      if(${arg} MATCHES "^[Vv][Tt][Kk]")
        string(
          REGEX
          REPLACE "^[Vv][Tt][Kk]"
                  ""
                  _arg
                  ${arg})
      else()
        set(_arg ${arg})
      endif()
      set(${ns}_LIBRARIES ${${ns}_LIBRARIES} VTK::${_arg})
    endforeach()
  endmacro()

  if(NOT VTK_RENDERING_BACKEND)
    set(VTK_RENDERING_BACKEND OpenGL2)
  endif()
endif()

# Older versions of VTK (VTK 5.5 for example) do not have VTK_VERSION, in this
# case it needs to be defined manually
if(NOT VTK_VERSION)
  set(VTK_VERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
endif()
if(NOT VTK_RENDERING_BACKEND)
  if(NOT COMMAND vtk_module_config)
    set(VTK_RENDERING_BACKEND OpenGL2)
  else()
    set(VTK_RENDERING_BACKEND OpenGL)
  endif()
endif()
set(_target_prefix "vtk")
if(VTK_VERSION VERSION_GREATER_EQUAL 8.90.0)
  set(_target_prefix "VTK::")
endif()
set(_target_freetypeopengl)
if(TARGET ${_target_prefix}RenderingFreeType${VTK_RENDERING_BACKEND})
  set(_target_freetypeopengl ${_target_prefix}RenderingFreeType${VTK_RENDERING_BACKEND})
endif()

set(_required_vtk_libraries ${_target_prefix}IOImage ${_target_prefix}ImagingSources)
if(ITK_WRAP_PYTHON)
  list(
    APPEND
    _required_vtk_libraries
    ${_target_prefix}WrappingPythonCore
    ${_target_prefix}CommonCore
    ${_target_prefix}CommonDataModel
    ${_target_prefix}CommonExecutionModel)
endif()
if(NOT
   VTK_RENDERING_BACKEND
   STREQUAL
   "None")
  list(
    APPEND
    _required_vtk_libraries
    ${_target_prefix}Rendering${VTK_RENDERING_BACKEND}
    ${_target_prefix}RenderingFreeType
    ${_target_freetypeopengl}
    ${_target_prefix}InteractionStyle
    ${_target_prefix}InteractionWidgets)
endif()
if(${VTK_VERSION} VERSION_LESS ${VERSION_MIN})
  message(ERROR " VtkGlue requires VTK version ${VERSION_MIN} or newer but the current version is ${VTK_VERSION}")
else()
  vtk_module_config(ITKVtkGlue_VTK ${_required_vtk_libraries})
  set(ITKVtkGlue_VTK_LIBRARIES ${_required_vtk_libraries})
endif()