1+ # For more information, please see: http://software.sci.utah.edu
2+ #
3+ # The MIT License
4+ #
5+ # Copyright (c) 2026 Scientific Computing and Imaging Institute,
6+ # University of Utah.
7+ #
8+ #
9+ # Permission is hereby granted, free of charge, to any person obtaining a
10+ # copy of this software and associated documentation files (the "Software"),
11+ # to deal in the Software without restriction, including without limitation
12+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
13+ # and/or sell copies of the Software, and to permit persons to whom the
14+ # Software is furnished to do so, subject to the following conditions:
15+ #
16+ # The above copyright notice and this permission notice shall be included
17+ # in all copies or substantial portions of the Software.
18+ #
19+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20+ # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25+ # DEALINGS IN THE SOFTWARE.
26+
27+ SET_PROPERTY (DIRECTORY PROPERTY "EP_BASE" ${ep_base} )
28+
29+ # ---- VTK version ----
30+ set (vtk_GIT_TAG "v9.6.1" )
31+
32+ # ---- Dependencies ----
33+ set (vtk_DEPENDENCIES)
34+ LIST (APPEND vtk_DEPENDENCIES
35+ LibPNG_external
36+ Zlib_external
37+ )
38+
39+ # ---- Pull dependency install dirs ----
40+ ExternalProject_Get_Property (Zlib_external INSTALL_DIR )
41+ set (ZLIB_INSTALL_DIR ${INSTALL_DIR} )
42+
43+ ExternalProject_Get_Property (LibPNG_external INSTALL_DIR )
44+ set (LIBPNG_INSTALL_DIR ${INSTALL_DIR} )
45+
46+ # ---- ExternalProject ----
47+ ExternalProject_Add (VTK_external
48+ DEPENDS ${vtk_DEPENDENCIES}
49+
50+ GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
51+ GIT_TAG ${vtk_GIT_TAG}
52+
53+ GIT_SUBMODULES ""
54+ GIT_SUBMODULES_RECURSE OFF
55+
56+ CMAKE_CACHE_ARGS
57+ -DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE }
58+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE }
59+ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
60+
61+ # ---- Core build options ----
62+ -DBUILD_SHARED_LIBS:BOOL=ON
63+ -DVTK_BUILD_ALL_MODULES:BOOL=OFF
64+ -DVTK_GROUP_ENABLE_StandAlone:STRING=WANT
65+ -DVTK_GROUP_ENABLE_Rendering:STRING=WANT
66+ -DVTK_GROUP_ENABLE_Imaging:STRING=WANT
67+ -DVTK_GROUP_ENABLE_IO:STRING=WANT
68+
69+ # ---- External dependency control ----
70+ -DVTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=ON
71+ -DVTK_MODULE_USE_EXTERNAL_VTK_png:BOOL=ON
72+
73+ # ---- Help VTK locate them (minimal first pass) ----
74+ -DZLIB_ROOT:PATH=${ZLIB_INSTALL_DIR}
75+ -DPNG_ROOT:PATH=${LIBPNG_INSTALL_DIR}
76+
77+ # ---- Wrapping ----
78+ -DVTK_WRAP_PYTHON:BOOL=OFF
79+ -DVTK_WRAP_JAVA:BOOL=OFF
80+
81+ # ---- Superbuild hygiene ----
82+ -DVTK_BUILD_TESTING:BOOL=OFF
83+ -DVTK_BUILD_EXAMPLES:BOOL=OFF
84+
85+ # ---- Install ----
86+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR >
87+ )
88+
89+ # ---- Export build dir ----
90+ ExternalProject_Get_Property (VTK_external BINARY_DIR )
91+ set (VTK_BUILD_DIR ${BINARY_DIR} CACHE PATH "" )
92+
93+ # ---- Export install dir ----
94+ ExternalProject_Get_Property (VTK_external INSTALL_DIR )
95+ set (VTK_INSTALL_DIR ${INSTALL_DIR} CACHE PATH "" )
96+
97+ message (STATUS "VTK_BUILD_DIR: ${VTK_BUILD_DIR} " )
98+ message (STATUS "VTK_INSTALL_DIR: ${VTK_INSTALL_DIR} " )
0 commit comments