aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2021-10-12 02:01:04 +0800
committerGitHub <noreply@github.com>2021-10-11 11:01:04 -0700
commitac3853c74e68e1781ee91d4bd0bb7e6e53ef6855 (patch)
treedda00b44234c827a79f1617aae9c281d25ca69a3 /ports
parent10e699ca7e5d404d7a481075b8431f6ceeae859e (diff)
downloadvcpkg-ac3853c74e68e1781ee91d4bd0bb7e6e53ef6855.tar.gz
vcpkg-ac3853c74e68e1781ee91d4bd0bb7e6e53ef6855.zip
[vtk] Add feature gdal and geojson, re-factory the feature select part (#20147)
* [vtk] Add feature gdal and geojson, re-factory the feature select part * version stuff * Fix feature option MPI * Fix find and use gdal. * version * Handle some of the same parameters * version
Diffstat (limited to 'ports')
-rw-r--r--ports/vtk/fix-gdal.patch39
-rw-r--r--ports/vtk/portfile.cmake194
-rw-r--r--ports/vtk/vcpkg.json21
3 files changed, 147 insertions, 107 deletions
diff --git a/ports/vtk/fix-gdal.patch b/ports/vtk/fix-gdal.patch
new file mode 100644
index 000000000..9a249efd1
--- /dev/null
+++ b/ports/vtk/fix-gdal.patch
@@ -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
diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake
index adfb0f3a0..89a55a25d 100644
--- a/ports/vtk/portfile.cmake
+++ b/ports/vtk/portfile.cmake
@@ -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)
@@ -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()
@@ -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()
@@ -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
@@ -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()
diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json
index 2437c2292..ca0058ec8 100644
--- a/ports/vtk/vcpkg.json
+++ b/ports/vtk/vcpkg.json
@@ -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": [
@@ -50,12 +50,13 @@
"description": "Build all vtk modules",
"dependencies": [
"ffmpeg",
- "gdal",
"libmysql",
{
"name": "vtk",
"default-features": false,
"features": [
+ "gdal",
+ "geojson",
"mpi",
"python",
"qt"
@@ -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": [