Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions ports/vtk/fix-gdal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/CMake/vtkInstallCMakePackage.cmake b/CMake/vtkInstallCMakePackage.cmake
index bcb2044..c87bb9c 100644
--- a/CMake/vtkInstallCMakePackage.cmake
+++ b/CMake/vtkInstallCMakePackage.cmake
@@ -113,7 +113,6 @@ set(vtk_cmake_patch_files
patches/3.18/FindPython/Support.cmake
patches/3.18/FindPython2.cmake
patches/3.18/FindPython3.cmake
- patches/99/FindGDAL.cmake
patches/99/FindHDF5.cmake
patches/99/FindJPEG.cmake
patches/99/FindLibArchive.cmake
diff --git a/Geovis/GDAL/CMakeLists.txt b/Geovis/GDAL/CMakeLists.txt
index dfd58f0..f46177f 100644
--- a/Geovis/GDAL/CMakeLists.txt
+++ b/Geovis/GDAL/CMakeLists.txt
@@ -9,4 +9,7 @@ vtk_module_add_module(VTK::GeovisGDAL
CLASSES ${classes})
vtk_module_link(VTK::GeovisGDAL
PRIVATE
- GDAL::GDAL)
+ ${GDAL_LIBRARIES})
+vtk_module_include(VTK::GeovisGDAL
+ PRIVATE
+ ${GDAL_INCLUDE_DIRS})
diff --git a/IO/GDAL/CMakeLists.txt b/IO/GDAL/CMakeLists.txt
index 0a1248a..621a060 100644
--- a/IO/GDAL/CMakeLists.txt
+++ b/IO/GDAL/CMakeLists.txt
@@ -9,4 +9,7 @@ vtk_module_add_module(VTK::IOGDAL
CLASSES ${classes})
vtk_module_link(VTK::IOGDAL
PRIVATE
- GDAL::GDAL)
+ ${GDAL_LIBRARIES})
+vtk_module_include(VTK::IOGDAL
+ PRIVATE
+ ${GDAL_INCLUDE_DIRS})
\ No newline at end of file
194 changes: 89 additions & 105 deletions ports/vtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,86 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
message(WARNING "You will need to install Xorg dependencies to build vtk:\napt-get install libxt-dev\n")
endif()

# TODO:
# - add loguru as a dependency requires #8682
# =============================================================================
# Clone & patch
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Kitware/VTK
REF 2959413ff190bc6e3ff40f5b6c1342edd2e5233f # v9.0.x used by ParaView 5.9.1
SHA512 16229c107ed904e8fa6850c3814b8bdcdf9700ef44f6ff5b3a77e7d793ce19954fc2c7b1219a0162cf588def6e990883cd3f808c316a4db6e65bd6cd1769dd3f
HEAD_REF master
PATCHES
FindLZMA.patch
FindLZ4.patch
Findproj.patch
pegtl.patch
pythonwrapper.patch # Required by ParaView to Wrap required classes
NoUndefDebug.patch # Required to link against correct Python library depending on build type.
python_debug.patch
fix-using-hdf5.patch
# CHECK: module-name-mangling.patch
# Last patch TODO: Patch out internal loguru
FindExpat.patch # The find_library calls are taken care of by vcpkg-cmake-wrapper.cmake of expat
# upstream vtkm patches to make it work with vtkm 1.6
vtkm.patch # To include an external VTKm build
1f00a0c9.patch
156fb524.patch
d107698a.patch
fix-gdal.patch
)

# =============================================================================
#Overwrite outdated modules if they have not been patched:
file(COPY "${CURRENT_PORT_DIR}/FindHDF5.cmake" DESTINATION "${SOURCE_PATH}/CMake/patches/99") # due to usage of targets in netcdf-c
# =============================================================================

# =============================================================================
# Options:
# Collect CMake options for optional components
if("qt" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_GROUP_ENABLE_Qt=YES
-DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES
-DVTK_MODULE_ENABLE_VTK_GUISupportQtSQL=YES
-DVTK_MODULE_ENABLE_VTK_RenderingQt=YES
-DVTK_MODULE_ENABLE_VTK_ViewsQt=YES
)

endif()
if("atlmfc" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_GUISupportMFC=YES
)
endif()
if("vtkm" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKmCore=YES
-DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKmDataModel=YES
-DVTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters=YES
-DVTK_MODULE_ENABLE_VTK_vtkm=YES
)
endif()
# TODO:
# - add loguru as a dependency requires #8682
vcpkg_check_features(OUT_FEATURE_OPTIONS VTK_FEATURE_OPTIONS
FEATURES
"qt" VTK_GROUP_ENABLE_Qt
"qt" VTK_MODULE_ENABLE_VTK_GUISupportQt
"qt" VTK_MODULE_ENABLE_VTK_GUISupportQtSQL
"qt" VTK_MODULE_ENABLE_VTK_RenderingQt
"qt" VTK_MODULE_ENABLE_VTK_ViewsQt
"atlmfc" VTK_MODULE_ENABLE_VTK_GUISupportMFC
"vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmCore
"vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmDataModel
"vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters
"vtkm" VTK_MODULE_ENABLE_VTK_vtkm
"python" VTK_MODULE_ENABLE_VTK_Python
"python" VTK_MODULE_ENABLE_VTK_PythonContext2D
"python" VTK_MODULE_ENABLE_VTK_PythonInterpreter
"paraview" VTK_MODULE_ENABLE_VTK_FiltersParallelStatistics
"paraview" VTK_MODULE_ENABLE_VTK_IOParallelExodus
"paraview" VTK_MODULE_ENABLE_VTK_RenderingParallel
"paraview" VTK_MODULE_ENABLE_VTK_RenderingVolumeAMR
"paraview" VTK_MODULE_ENABLE_VTK_IOXdmf2
"paraview" VTK_MODULE_ENABLE_VTK_IOH5part
"paraview" VTK_MODULE_ENABLE_VTK_IOParallelLSDyna
"paraview" VTK_MODULE_ENABLE_VTK_IOTRUCHAS
"paraview" VTK_MODULE_ENABLE_VTK_IOVPIC
"paraview" VTK_MODULE_ENABLE_VTK_RenderingAnnotation
"paraview" VTK_MODULE_ENABLE_VTK_DomainsChemistry
"paraview" VTK_MODULE_ENABLE_VTK_FiltersParallelDIY2
"mpi" VTK_GROUP_ENABLE_MPI
"opengl" VTK_MODULE_ENABLE_VTK_ImagingOpenGL2
"opengl" VTK_MODULE_ENABLE_VTK_RenderingGL2PSOpenGL2
"opengl" VTK_MODULE_ENABLE_VTK_RenderingOpenGL2
"opengl" VTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2
"opengl" VTK_MODULE_ENABLE_VTK_opengl
"openvr" VTK_MODULE_ENABLE_VTK_RenderingOpenVR
"gdal" VTK_MODULE_ENABLE_VTK_IOGDAL
"geojson" VTK_MODULE_ENABLE_VTK_IOGeoJSON
)

# Replace common value to vtk value
list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=ON" "=YES")
list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=OFF" "=DONT_WANT")

if("python" IN_LIST FEATURES)
vcpkg_find_acquire_program(PYTHON3)
Expand All @@ -39,42 +90,21 @@ if("python" IN_LIST FEATURES)
-DVTK_PYTHON_VERSION=3
-DPython3_FIND_REGISTRY=NEVER
"-DPython3_EXECUTABLE:PATH=${PYTHON3}"
-DVTK_MODULE_ENABLE_VTK_Python=YES
-DVTK_MODULE_ENABLE_VTK_PythonContext2D=YES
-DVTK_MODULE_ENABLE_VTK_PythonInterpreter=YES
)
#VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages
endif()

if("paraview" IN_LIST FEATURES)
if ("paraview" IN_LIST FEATURES OR "opengl" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_FiltersParallelStatistics=YES
-DVTK_MODULE_ENABLE_VTK_IOParallelExodus=YES
-DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingParallel=YES
-DVTK_MODULE_ENABLE_VTK_RenderingVolumeAMR=YES
-DVTK_MODULE_ENABLE_VTK_IOXdmf2=YES
-DVTK_MODULE_ENABLE_VTK_IOH5part=YES
-DVTK_MODULE_ENABLE_VTK_IOParallelLSDyna=YES
-DVTK_MODULE_ENABLE_VTK_IOTRUCHAS=YES
-DVTK_MODULE_ENABLE_VTK_IOVPIC=YES
-DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingAnnotation=YES
-DVTK_MODULE_ENABLE_VTK_DomainsChemistry=YES
-DVTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=YES
)
if("python" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib=YES
)
endif()
endif()

if("mpi" IN_LIST FEATURES)
if("paraview" IN_LIST FEATURES AND "python" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_GROUP_ENABLE_MPI=YES
-DVTK_USE_MPI=YES
-DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib=YES
)
endif()

Expand All @@ -84,25 +114,6 @@ if("mpi" IN_LIST FEATURES AND "python" IN_LIST FEATURES)
)
endif()

if("opengl" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_ImagingOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingGL2PSOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_opengl=YES
)
endif()

if ("openvr" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_RenderingOpenVR=YES
)
endif()

if("cuda" IN_LIST FEATURES AND CMAKE_HOST_WIN32)
vcpkg_add_to_path("$ENV{CUDA_PATH}/bin")
endif()
Expand All @@ -116,61 +127,32 @@ endif()
if("all" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg
-DVTK_FORBID_DOWNLOADS=OFF
)
else()
list(APPEND ADDITIONAL_OPTIONS
-DVTK_FORBID_DOWNLOADS=ON
)
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"cuda" VTK_USE_CUDA
"mpi" VTK_USE_MPI
"all" VTK_BUILD_ALL_MODULES
)


# =============================================================================
# Clone & patch


vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Kitware/VTK
REF 2959413ff190bc6e3ff40f5b6c1342edd2e5233f # v9.0.x used by ParaView 5.9.1
SHA512 16229c107ed904e8fa6850c3814b8bdcdf9700ef44f6ff5b3a77e7d793ce19954fc2c7b1219a0162cf588def6e990883cd3f808c316a4db6e65bd6cd1769dd3f
HEAD_REF master
PATCHES
FindLZMA.patch
FindLZ4.patch
Findproj.patch
pegtl.patch
pythonwrapper.patch # Required by ParaView to Wrap required classes
NoUndefDebug.patch # Required to link against correct Python library depending on build type.
python_debug.patch
fix-using-hdf5.patch
# CHECK: module-name-mangling.patch
# Last patch TODO: Patch out internal loguru
FindExpat.patch # The find_library calls are taken care of by vcpkg-cmake-wrapper.cmake of expat
# upstream vtkm patches to make it work with vtkm 1.6
vtkm.patch # To include an external VTKm build
1f00a0c9.patch
156fb524.patch
d107698a.patch
)

# =============================================================================
#Overwrite outdated modules if they have not been patched:
file(COPY "${CURRENT_PORT_DIR}/FindHDF5.cmake" DESTINATION "${SOURCE_PATH}/CMake/patches/99") # due to usage of targets in netcdf-c
# =============================================================================

# =============================================================================
# Configure & Install

# We set all libraries to "system" and explicitly list the ones that should use embedded copies
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${FEATURE_OPTIONS}
OPTIONS
${FEATURE_OPTIONS}
${VTK_FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DVTK_BUILD_TESTING=OFF
-DVTK_BUILD_EXAMPLES=OFF
-DVTK_FORBID_DOWNLOADS=ON
-DVTK_ENABLE_REMOTE_MODULES=OFF
# VTK groups to enable
-DVTK_GROUP_ENABLE_StandAlone=YES
Expand All @@ -182,6 +164,8 @@ vcpkg_cmake_configure(
-DVTK_USE_EXTERNAL:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps:BOOL=OFF # Not yet in VCPKG
${ADDITIONAL_OPTIONS}
-DVTK_DEBUG_MODULE_ALL=ON
-DVTK_DEBUG_MODULE=ON
)

vcpkg_cmake_install()
Expand Down
21 changes: 19 additions & 2 deletions ports/vtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vtk",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 2,
"port-version": 3,
"description": "Software system for 3D computer graphics, image processing, and visualization",
"homepage": "https://github.com/Kitware/VTK",
"dependencies": [
Expand Down Expand Up @@ -50,12 +50,13 @@
"description": "Build all vtk modules",
"dependencies": [
"ffmpeg",
"gdal",
"libmysql",
{
"name": "vtk",
"default-features": false,
"features": [
"gdal",
"geojson",
"mpi",
"python",
"qt"
Expand Down Expand Up @@ -87,6 +88,22 @@
"cuda"
]
},
"gdal": {
"description": "Support GDAL compilation",
"dependencies": [
"gdal",
{
"name": "vtk",
"default-features": false,
"features": [
"mpi"
]
}
]
},
"geojson": {
"description": "Convert Geo JSON format to vtkPolyData"
},
"mpi": {
"description": "MPI functionality for VTK",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6886,7 +6886,7 @@
},
"vtk": {
"baseline": "9.0.3-pv5.9.1",
"port-version": 2
"port-version": 3
},
"vtk-dicom": {
"baseline": "0.8.12",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vtk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1b201a8e060b6c2688ccc2e96cae175f2d8af205",
"version-semver": "9.0.3-pv5.9.1",
"port-version": 3
},
{
"git-tree": "5e50a05b2ff0cc2f4df601ddb146c75a2f266a6a",
"version-semver": "9.0.3-pv5.9.1",
Expand Down