aboutsummaryrefslogtreecommitdiff
path: root/ports/vtk
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-11-22 09:47:40 -0800
committerGitHub <noreply@github.com>2019-11-22 09:47:40 -0800
commit45f4b820e5743b89bca3508ba2028cdd5d8bbd17 (patch)
treef874a8c4a7392309bdbb86447288597ec0a4a281 /ports/vtk
parent62d67d3bf8eeff1afa8009041fd08b8822676b7b (diff)
parent8831e8f25f1ff6546ee4a5291b91d599421637b3 (diff)
downloadvcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.tar.gz
vcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.zip
Merge branch 'master' into vcpkg_nuget
Diffstat (limited to 'ports/vtk')
-rw-r--r--ports/vtk/CONTROL10
-rw-r--r--ports/vtk/fix-find-lz4.patch2
-rw-r--r--ports/vtk/fix-find-lzma.patch16
-rw-r--r--ports/vtk/fix-proj4.patch175
-rw-r--r--ports/vtk/portfile.cmake52
5 files changed, 218 insertions, 37 deletions
diff --git a/ports/vtk/CONTROL b/ports/vtk/CONTROL
index 7b07132d2..990e2aa32 100644
--- a/ports/vtk/CONTROL
+++ b/ports/vtk/CONTROL
@@ -1,8 +1,8 @@
Source: vtk
-Version: 8.2.0-4
+Version: 8.2.0-9
Description: Software system for 3D computer graphics, image processing, and visualization
Homepage: https://github.com/Kitware/VTK
-Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, libjpeg-turbo, proj4, lz4, libtheora, atlmfc (windows), eigen3, double-conversion, pugixml, libharu, sqlite3, netcdf-c
+Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, libjpeg-turbo, proj4, lz4, libtheora, eigen3, double-conversion, pugixml, libharu, sqlite3, netcdf-c
Feature: openvr
Description: OpenVR functionality for VTK
@@ -14,8 +14,12 @@ Build-Depends: qt5
Feature: mpi
Description: MPI functionality for VTK
-Build-Depends: msmpi, hdf5[parallel]
+Build-Depends: mpi, hdf5[parallel]
Feature: python
Description: Python functionality for VTK
Build-Depends: python3
+
+Feature: atlmfc
+Description: Mfc functionality for vtk on Windows
+Build-Depends: atlmfc (windows) \ No newline at end of file
diff --git a/ports/vtk/fix-find-lz4.patch b/ports/vtk/fix-find-lz4.patch
index 7389a24f4..488640de8 100644
--- a/ports/vtk/fix-find-lz4.patch
+++ b/ports/vtk/fix-find-lz4.patch
@@ -6,7 +6,7 @@ index 07343e1f79..b43a9af2c7 100644
-
-find_library(LZ4_LIBRARIES NAMES lz4)
+find_library(LZ4_LIBRARY NAMES lz4 PATH_SUFFIXES lib)
-+find_library(LZ4_LIBRARY_DEBUG NAME lz4d PATH_SUFFIXES debug/lib)
++find_library(LZ4_LIBRARY_DEBUG NAMES lz4d PATH_SUFFIXES debug/lib)
find_path(LZ4_INCLUDE_DIRS NAMES lz4.h)
+if(NOT LZ4_LIBRARY_DEBUG)
diff --git a/ports/vtk/fix-find-lzma.patch b/ports/vtk/fix-find-lzma.patch
new file mode 100644
index 000000000..b2e375fc4
--- /dev/null
+++ b/ports/vtk/fix-find-lzma.patch
@@ -0,0 +1,16 @@
+diff --git a/CMake/FindLZMA.cmake b/CMake/FindLZMA.cmake
+index 213ab18df1..1e290da4cb 100644
+--- a/CMake/FindLZMA.cmake
++++ b/CMake/FindLZMA.cmake
+@@ -1,7 +1,10 @@
+
+-find_library(LZMA_LIBRARIES NAMES lzma)
++find_library(LZMA_LIBRARY_RELEASE NAMES lzma PATH_SUFFIXES lib)
++find_library(LZMA_LIBRARY_DEBUG NAMES lzmad PATH_SUFFIXES debug/lib)
+ find_path(LZMA_INCLUDE_DIRS NAMES lzma.h)
+
++select_library_configurations(LZMA)
++
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(LZMA
+ DEFAULT_MSG
diff --git a/ports/vtk/fix-proj4.patch b/ports/vtk/fix-proj4.patch
new file mode 100644
index 000000000..ad49b1523
--- /dev/null
+++ b/ports/vtk/fix-proj4.patch
@@ -0,0 +1,175 @@
+diff --git a/Geovis/Core/vtkGeoProjection.cxx b/Geovis/Core/vtkGeoProjection.cxx
+index f3a8852..8240603 100644
+--- a/Geovis/Core/vtkGeoProjection.cxx
++++ b/Geovis/Core/vtkGeoProjection.cxx
+@@ -72,6 +72,9 @@ public:
+ }
+
+ std::map< std::string, std::string > OptionalParameters;
++#if PROJ_VERSION_MAJOR >= 5
++ PJ_PROJ_INFO ProjInfo;
++#endif
+ };
+
+ //-----------------------------------------------------------------------------
+@@ -80,7 +83,7 @@ int vtkGeoProjection::GetNumberOfProjections()
+ if ( vtkGeoProjectionNumProj < 0 )
+ {
+ vtkGeoProjectionNumProj = 0;
+- for ( const PJ_LIST* pj = pj_get_list_ref(); pj && pj->id; ++ pj )
++ for ( const PJ_LIST* pj = proj_list_operations(); pj && pj->id; ++ pj )
+ ++ vtkGeoProjectionNumProj;
+ }
+ return vtkGeoProjectionNumProj;
+@@ -91,7 +94,7 @@ const char* vtkGeoProjection::GetProjectionName( int projection )
+ if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() )
+ return nullptr;
+
+- return pj_get_list_ref()[projection].id;
++ return proj_list_operations()[projection].id;
+ }
+ //-----------------------------------------------------------------------------
+ const char* vtkGeoProjection::GetProjectionDescription( int projection )
+@@ -99,7 +102,7 @@ const char* vtkGeoProjection::GetProjectionDescription( int projection )
+ if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() )
+ return nullptr;
+
+- return pj_get_list_ref()[projection].descr[0];
++ return proj_list_operations()[projection].descr[0];
+ }
+ //-----------------------------------------------------------------------------
+ vtkGeoProjection::vtkGeoProjection()
+@@ -144,7 +147,7 @@ void vtkGeoProjection::PrintSelf( ostream& os, vtkIndent indent )
+ int vtkGeoProjection::GetIndex()
+ {
+ int i = 0;
+- for ( const PJ_LIST* proj = pj_get_list_ref(); proj && proj->id; ++ proj, ++ i )
++ for ( const PJ_LIST* proj = proj_list_operations(); proj && proj->id; ++ proj, ++ i )
+ {
+ if ( ! strcmp( proj->id, this->Name ) )
+ {
+@@ -161,7 +164,11 @@ const char* vtkGeoProjection::GetDescription()
+ {
+ return nullptr;
+ }
++#if PROJ_VERSION_MAJOR >= 5
++ return this->Internals->ProjInfo.description;
++#else
+ return this->Projection->descr;
++#endif
+ }
+ //-----------------------------------------------------------------------------
+ projPJ vtkGeoProjection::GetProjection()
+@@ -232,6 +239,9 @@ int vtkGeoProjection::UpdateProjection()
+ this->ProjectionMTime = this->GetMTime();
+ if ( this->Projection )
+ {
++#if PROJ_VERSION_MAJOR >= 5
++ this->Internals->ProjInfo = proj_pj_info(this->Projection);
++#endif
+ return 0;
+ }
+ return 1;
+diff --git a/Geovis/Core/vtkGeoTransform.cxx b/Geovis/Core/vtkGeoTransform.cxx
+index aeeabc1..b80a8c0 100644
+--- a/Geovis/Core/vtkGeoTransform.cxx
++++ b/Geovis/Core/vtkGeoTransform.cxx
+@@ -167,9 +167,17 @@ void vtkGeoTransform::InternalTransformPoints( double* x, vtkIdType numPts, int
+ double* coord = x;
+ for ( vtkIdType i = 0; i < numPts; ++ i )
+ {
++#if PROJ_VERSION_MAJOR >= 5
++ xy.x = coord[0]; xy.y = coord[1];
++#else
+ xy.u = coord[0]; xy.v = coord[1];
++#endif
+ lp = pj_inv( xy, src );
++#if PROJ_VERSION_MAJOR >= 5
++ coord[0] = lp.lam; coord[1] = lp.phi;
++#else
+ coord[0] = lp.u; coord[1] = lp.v;
++#endif
+ coord += stride;
+ }
+ }
+@@ -191,9 +199,17 @@ void vtkGeoTransform::InternalTransformPoints( double* x, vtkIdType numPts, int
+ double* coord = x;
+ for ( vtkIdType i = 0; i < numPts; ++ i )
+ {
++#if PROJ_VERSION_MAJOR >= 5
++ lp.lam = coord[0]; lp.phi = coord[1];
++#else
+ lp.u = coord[0]; lp.v = coord[1];
++#endif
+ xy = pj_fwd( lp, dst );
++#if PROJ_VERSION_MAJOR >= 5
++ coord[0] = xy.x; coord[1] = xy.y;
++#else
+ coord[0] = xy.u; coord[1] = xy.v;
++#endif
+ coord += stride;
+ }
+ }
+diff --git a/ThirdParty/libproj/CMakeLists.txt b/ThirdParty/libproj/CMakeLists.txt
+index a19609e..e23e44b 100644
+--- a/ThirdParty/libproj/CMakeLists.txt
++++ b/ThirdParty/libproj/CMakeLists.txt
+@@ -1,4 +1,9 @@
+ vtk_module_third_party(LibPROJ
+ LIBRARIES vtklibproj
++ USE_VARIABLES LibPROJ_MAJOR_VERSION
+ INCLUDE_DIRS ${vtklibproj_SOURCE_DIR}/vtklibproj
+ ${vtklibproj_BINARY_DIR}/vtklibproj)
++
++if (NOT VTK_MODULE_USE_EXTERNAL_VTK_libproj)
++ set(LibPROJ_MAJOR_VERSION "4")
++endif ()
+\ No newline at end of file
+diff --git a/ThirdParty/libproj/vtk_libproj.h.in b/ThirdParty/libproj/vtk_libproj.h.in
+index cd9edc3..d441a1a 100644
+--- a/ThirdParty/libproj/vtk_libproj.h.in
++++ b/ThirdParty/libproj/vtk_libproj.h.in
+@@ -17,8 +17,23 @@
+
+ /* Use the libproj library configured for VTK. */
+ #cmakedefine VTK_USE_SYSTEM_LIBPROJ
++
++#define VTK_LibPROJ_MAJOR_VERSION @LibPROJ_MAJOR_VERSION@
++
++#if VTK_LibPROJ_MAJOR_VERSION < 5
++# define PROJ_VERSION_MAJOR @LibPROJ_MAJOR_VERSION@
++# define proj_list_operations pj_get_list_ref
++#endif
+ #ifdef VTK_USE_SYSTEM_LIBPROJ
+-# include <projects.h>
++# if VTK_LibPROJ_MAJOR_VERSION >= 5
++# include <proj.h>
++# endif
++# if VTK_LibPROJ_MAJOR_VERSION < 6
++# include <projects.h>
++# endif
++# if VTK_LibPROJ_MAJOR_VERSION >= 6
++# define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
++# endif
+ # include <proj_api.h>
+ # include <geodesic.h>
+ #else
+diff --git a/CMake/FindLibPROJ.cmake b/CMake/FindLibPROJ.cmake
+index 2d8301d..d8d08cd 100644
+--- a/CMake/FindLibPROJ.cmake
++++ b/CMake/FindLibPROJ.cmake
+@@ -5,6 +5,14 @@
+ # LibPROJ_LIBRARIES to libproj4 and any dependent libraries
+ # If LibPROJ_REQUIRED is defined, then a fatal error message will be generated if libproj4 is not found
+
++find_package(PROJ4 6 CONFIG REQUIRED)
++if (PROJ4_FOUND)
++ set(LibPROJ_FOUND 1)
++ set(LibPROJ_INCLUDE_DIR ${PROJ4_INCLUDE_DIRS})
++ set(LibPROJ_LIBRARIES ${PROJ_LIBRARY})
++ set(LibPROJ_MAJOR_VERSION 6)
++endif()
++
+ if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibPROJ_LIBRARIES OR NOT LibPROJ_FOUND )
+
+ if ( $ENV{LibPROJ_DIR} )
diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake
index 69d2ddd2a..c2d12c498 100644
--- a/ports/vtk/portfile.cmake
+++ b/ports/vtk/portfile.cmake
@@ -8,30 +8,13 @@ set(VTK_SHORT_VERSION "8.2")
set(VTK_LONG_VERSION "${VTK_SHORT_VERSION}.0")
# =============================================================================
# Options:
-
-if ("qt" IN_LIST FEATURES)
- set(VTK_WITH_QT ON )
-else()
- set(VTK_WITH_QT OFF )
-endif()
-
-if ("mpi" IN_LIST FEATURES)
- set(VTK_Group_MPI ON)
-else()
- set(VTK_Group_MPI OFF)
-endif()
-
-if ("python" IN_LIST FEATURES)
- set(VTK_WITH_PYTHON ON)
-else()
- set(VTK_WITH_PYTHON OFF)
-endif()
-
-if("openvr" IN_LIST FEATURES)
- set(Module_vtkRenderingOpenVR ON)
-else()
- set(Module_vtkRenderingOpenVR OFF)
-endif()
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ qt VTK_WITH_QT
+ mpi VTK_Group_MPI
+ python VTK_WITH_PYTHON
+ openvr Module_vtkRenderingOpenVR
+ atlmfc Module_vtkGUISupportMFC
+)
set(VTK_WITH_ALL_MODULES OFF) # IMPORTANT: if ON make sure `qt5`, `mpi`, `python3`, `ffmpeg`, `gdal`, `fontconfig`,
# `libmysql` and `atlmfc` are listed as dependency in the CONTROL file
@@ -49,6 +32,8 @@ vcpkg_from_github(
fix_ogg_linkage.patch
fix-pugixml-link.patch
hdf5_static.patch
+ fix-find-lzma.patch
+ fix-proj4.patch
)
# Remove the FindGLEW.cmake and FindPythonLibs.cmake that are distributed with VTK,
@@ -72,6 +57,7 @@ if(VTK_WITH_QT)
endif()
if(VTK_WITH_PYTHON)
+ vcpkg_find_acquire_program(PYTHON3)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_WRAP_PYTHON=ON
-DVTK_PYTHON_VERSION=3
@@ -92,14 +78,12 @@ if(VTK_WITH_ALL_MODULES)
# -DVTK_USE_SYSTEM_XDMF3=ON
# -DVTK_USE_SYSTEM_ZFP=ON
# -DVTK_USE_SYSTEM_ZOPE=ON
+ # -DVTK_USE_SYSTEM_LIBPROJ=ON
)
endif()
-if(NOT VCPKG_CMAKE_SYSTEM_NAME)
- set(Module_vtkGUISupportMFC ON)
-else()
- set(Module_vtkGUISupportMFC OFF)
-endif()
+set(PROJ_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/proj.lib")
+set(PROJ_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/proj_d.lib")
# =============================================================================
# Configure & Install
@@ -107,7 +91,7 @@ endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- OPTIONS
+ OPTIONS ${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DBUILD_EXAMPLES=OFF
-DVTK_INSTALL_INCLUDE_DIR=include
@@ -124,11 +108,13 @@ vcpkg_configure_cmake(
# Select modules / groups to install
-DVTK_Group_Imaging=ON
-DVTK_Group_Views=ON
- -DModule_vtkGUISupportMFC=${Module_vtkGUISupportMFC}
- -DModule_vtkRenderingOpenVR=${Module_vtkRenderingOpenVR}
- -DVTK_Group_MPI=${VTK_Group_MPI}
+ -DPYTHON_EXECUTABLE=${PYTHON3}
${ADDITIONAL_OPTIONS}
+ OPTIONS_RELEASE
+ -DPROJ_LIBRARY=${PROJ_LIBRARY_REL}
+ OPTIONS_DEBUG
+ -DPROJ_LIBRARY=${PROJ_LIBRARY_DBG}
)
vcpkg_install_cmake()