diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/vtk | |
Diffstat (limited to 'vcpkg/ports/vtk')
34 files changed, 1989 insertions, 0 deletions
diff --git a/vcpkg/ports/vtk/FindExpat.patch b/vcpkg/ports/vtk/FindExpat.patch new file mode 100644 index 0000000..a9fdc46 --- /dev/null +++ b/vcpkg/ports/vtk/FindExpat.patch @@ -0,0 +1,48 @@ +diff --git a/CMake/FindEXPAT.cmake b/CMake/FindEXPAT.cmake +index 45d923764..0ebcd3c83 100644 +--- a/CMake/FindEXPAT.cmake ++++ b/CMake/FindEXPAT.cmake +@@ -73,15 +73,37 @@ if(EXPAT_FOUND) + + if(NOT TARGET EXPAT::EXPAT) + include(vtkDetectLibraryType) +- vtk_detect_library_type(expat_library_type +- PATH "${EXPAT_LIBRARY}") ++ if(EXPAT_LIBRARY_RELEASE) ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY_RELEASE}") ++ elseif(EXPAT_LIBRARY_DEBUG) ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY_RELEASE}") ++ else() ++ vtk_detect_library_type(expat_library_type ++ PATH "${EXPAT_LIBRARY}") ++ endif() ++ + add_library(EXPAT::EXPAT "${expat_library_type}" IMPORTED) + unset(expat_library_type) + set_target_properties(EXPAT::EXPAT PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "C" +- IMPORTED_LOCATION "${EXPAT_LIBRARY}" +- IMPORTED_IMPLIB "${EXPAT_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") ++ IMPORTED_LINK_INTERFACE_LANGUAGES "C" ++ INTERFACE_INCLUDE_DIRECTORIES "${EXPAT_INCLUDE_DIRS}") ++ if(EXPAT_LIBRARY_RELEASE) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION_RELEASE "${EXPAT_LIBRARY_RELEASE}" ++ IMPORTED_IMPLIB_RELEASE "${EXPAT_LIBRARY_RELEASE}") ++ endif() ++ if(EXPAT_LIBRARY_DEBUG) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION_DEBUG "${EXPAT_LIBRARY_DEBUG}" ++ IMPORTED_IMPLIB_DEBUG "${EXPAT_LIBRARY_DEBUG}") ++ endif() ++ if(EXPAT_LIBRARY_RELEASE OR EXPAT_LIBRARY_DEBUG AND NOT (EXPAT_LIBRARY_RELEASE AND EXPAT_LIBRARY_DEBUG)) ++ set_target_properties(EXPAT::EXPAT PROPERTIES ++ IMPORTED_LOCATION "${EXPAT_LIBRARY}" ++ IMPORTED_IMPLIB "${EXPAT_LIBRARY}") ++ endif() + endif() + endif() + diff --git a/vcpkg/ports/vtk/FindHDF5.cmake b/vcpkg/ports/vtk/FindHDF5.cmake new file mode 100644 index 0000000..9d92970 --- /dev/null +++ b/vcpkg/ports/vtk/FindHDF5.cmake @@ -0,0 +1,22 @@ +find_package(hdf5 CONFIG REQUIRED)
+if(NOT TARGET hdf5::hdf5 AND (TARGET hdf5::hdf5-static OR TARGET hdf5::hdf5-shared))
+ add_library(hdf5::hdf5 INTERFACE IMPORTED)
+ if(TARGET hdf5::hdf5-shared)
+ target_link_libraries(hdf5::hdf5 INTERFACE hdf5::hdf5-shared)
+ elseif(TARGET hdf5::hdf5-static)
+ target_link_libraries(hdf5::hdf5 INTERFACE hdf5::hdf5-static)
+ endif()
+endif()
+
+if(NOT TARGET hdf5::hdf5_hl AND (TARGET hdf5::hdf5_hl-static OR TARGET hdf5::hdf5_hl-shared))
+ add_library(hdf5::hdf5_hl INTERFACE IMPORTED)
+ if(TARGET hdf5::hdf5_hl-shared)
+ target_link_libraries(hdf5::hdf5_hl INTERFACE hdf5::hdf5_hl-shared)
+ elseif(TARGET hdf5::hdf5_hl-static)
+ target_link_libraries(hdf5::hdf5_hl INTERFACE hdf5::hdf5_hl-static)
+ endif()
+endif()
+
+set(HDF5_IS_PARALLEL "${HDF5_ENABLE_PARALLEL}" CACHE BOOL "" FORCE)
+set(HDF5_FOUND ON CACHE BOOL "" FORCE)
+set(hdf5_FOUND ON CACHE BOOL "" FORCE)
diff --git a/vcpkg/ports/vtk/FindLZ4.patch b/vcpkg/ports/vtk/FindLZ4.patch new file mode 100644 index 0000000..68ce9ad --- /dev/null +++ b/vcpkg/ports/vtk/FindLZ4.patch @@ -0,0 +1,49 @@ +diff --git a/CMake/FindLZ4.cmake b/CMake/FindLZ4.cmake +index 8c94e3bcd..ade3f9451 100644 +--- a/CMake/FindLZ4.cmake ++++ b/CMake/FindLZ4.cmake +@@ -1,38 +1,5 @@ +-find_path(LZ4_INCLUDE_DIR +- NAMES lz4.h +- DOC "lz4 include directory") +-mark_as_advanced(LZ4_INCLUDE_DIR) +-find_library(LZ4_LIBRARY +- NAMES lz4 liblz4 +- DOC "lz4 library") +-mark_as_advanced(LZ4_LIBRARY) +- +-if (LZ4_INCLUDE_DIR) +- file(STRINGS "${LZ4_INCLUDE_DIR}/lz4.h" _lz4_version_lines +- REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)") +- string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}") +- string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}") +- string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}") +- set(LZ4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}") +- unset(_lz4_version_major) +- unset(_lz4_version_minor) +- unset(_lz4_version_release) +- unset(_lz4_version_lines) +-endif () +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LZ4 +- REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR +- VERSION_VAR LZ4_VERSION) +- +-if (LZ4_FOUND) +- set(LZ4_INCLUDE_DIRS "${LZ4_INCLUDE_DIR}") +- set(LZ4_LIBRARIES "${LZ4_LIBRARY}") +- +- if (NOT TARGET LZ4::LZ4) +- add_library(LZ4::LZ4 UNKNOWN IMPORTED) +- set_target_properties(LZ4::LZ4 PROPERTIES +- IMPORTED_LOCATION "${LZ4_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}") +- endif () +-endif () ++find_package(LZ4 NAMES lz4 REQUIRED) ++if(NOT TARGET LZ4::LZ4) ++ add_library(LZ4::LZ4 INTERFACE IMPORTED) ++ target_link_libraries(LZ4::LZ4 INTERFACE lz4::lz4) ++endif() +\ No newline at end of file diff --git a/vcpkg/ports/vtk/FindLZMA.patch b/vcpkg/ports/vtk/FindLZMA.patch new file mode 100644 index 0000000..990f2b2 --- /dev/null +++ b/vcpkg/ports/vtk/FindLZMA.patch @@ -0,0 +1,16 @@ +diff --git a/CMake/FindLZMA.cmake b/CMake/FindLZMA.cmake +index 0c8c794..796558c 100644 +--- a/CMake/FindLZMA.cmake ++++ b/CMake/FindLZMA.cmake +@@ -1,3 +1,11 @@ ++find_package(LibLZMA) ++set(LZMA_INCLUDE_DIR "${LIBLZMA_INCLUDE_DIR}" CACHE INTERNAL "") ++set(LZMA_LIBRARY "${LIBLZMA_LIBRARIES}" CACHE INTERNAL "") ++if(NOT TARGET LZMA::LZMA) ++ add_library(LZMA::LZMA INTERFACE IMPORTED) ++ target_link_libraries(LZMA::LZMA INTERFACE LibLZMA::LibLZMA) ++endif() ++ + find_path(LZMA_INCLUDE_DIR + NAMES lzma.h + DOC "lzma include directory") diff --git a/vcpkg/ports/vtk/NoUndefDebug.patch b/vcpkg/ports/vtk/NoUndefDebug.patch new file mode 100644 index 0000000..a7bb750 --- /dev/null +++ b/vcpkg/ports/vtk/NoUndefDebug.patch @@ -0,0 +1,13 @@ +diff --git a/Utilities/Python/vtkPython.h b/Utilities/Python/vtkPython.h +index 166f24104..79ae1d371 100644 +--- a/Utilities/Python/vtkPython.h ++++ b/Utilities/Python/vtkPython.h +@@ -53,7 +53,7 @@ + #include <sys/stat.h> + #include <time.h> + #include <wchar.h> +-#undef _DEBUG ++ + #if defined(_MSC_VER) + #define _CRT_NOFORCE_MANIFEST 1 + #endif diff --git a/vcpkg/ports/vtk/afxdll.patch b/vcpkg/ports/vtk/afxdll.patch new file mode 100644 index 0000000..b528bf4 --- /dev/null +++ b/vcpkg/ports/vtk/afxdll.patch @@ -0,0 +1,13 @@ +diff --git a/GUISupport/MFC/CMakeLists.txt b/GUISupport/MFC/CMakeLists.txt
+index 66b52f1f6..7fbfef908 100644
+--- a/GUISupport/MFC/CMakeLists.txt
++++ b/GUISupport/MFC/CMakeLists.txt
+@@ -10,7 +10,7 @@ endif ()
+ # Determine whether the shared or static MFC implementation to use.
+ if (use_policy_0091) # XXX(cmake-3.15)
+ if (NOT CMAKE_MSVC_RUNTIME_LIBRARY OR # The default uses `DLL`.
+- CMAKE_MSVC_RUNTIME_LIBRARY MATCHES "DLL$")
++ VCPKG_CRT_LINKAGE MATCHES "dynamic")
+ set(vtk_mfc_static 0)
+ else ()
+ set(vtk_mfc_static 1)
diff --git a/vcpkg/ports/vtk/backport-bda8324.diff b/vcpkg/ports/vtk/backport-bda8324.diff new file mode 100644 index 0000000..8cf4c66 --- /dev/null +++ b/vcpkg/ports/vtk/backport-bda8324.diff @@ -0,0 +1,13 @@ +diff --git a/Parallel/Core/vtkThreadedCallbackQueue.txx b/Parallel/Core/vtkThreadedCallbackQueue.txx +index 8f5a4414..fd55136d 100644 +--- a/Parallel/Core/vtkThreadedCallbackQueue.txx ++++ b/Parallel/Core/vtkThreadedCallbackQueue.txx +@@ -275,7 +275,7 @@ template <class T> + struct vtkThreadedCallbackQueue::InvokerImpl::DereferenceImpl<T, + std::true_type /* CanBeDereferencedT */> + { +- using Type = decltype(*std::declval<T>()); ++ using Type = typename std::remove_pointer<decltype(*std::declval<T>())>::type; + static Type& Get(T& instance) { return *instance; } + }; + diff --git a/vcpkg/ports/vtk/cgns.patch b/vcpkg/ports/vtk/cgns.patch new file mode 100644 index 0000000..5b7258a --- /dev/null +++ b/vcpkg/ports/vtk/cgns.patch @@ -0,0 +1,106 @@ +diff --git a/CMake/FindCGNS.cmake b/CMake/FindCGNS.cmake +index 005f1afd9..35c6de184 100644 +--- a/CMake/FindCGNS.cmake ++++ b/CMake/FindCGNS.cmake +@@ -1,48 +1,53 @@ +-# +-# Find the native CGNS includes and library +-# +-# CGNS_INCLUDE_DIR - where to find cgns.h, etc. +-# CGNS_LIBRARIES - List of fully qualified libraries to link against when using CGNS. +-# CGNS_FOUND - Do not attempt to use CGNS if "no" or undefined. +- +-find_path(CGNS_INCLUDE_DIR +- NAMES +- cgnslib.h +- PATHS +- /usr/local/include +- /usr/include +- DOC "CGNS include directory") +-mark_as_advanced(CGNS_INCLUDE_DIR) +- +-find_library(CGNS_LIBRARY +- NAMES +- cgns +- DOC "CGNS library") +-mark_as_advanced(CGNS_LIBRARY) +- +-if (CGNS_INCLUDE_DIR) +- file(STRINGS "${CGNS_INCLUDE_DIR}/cgnslib.h" version +- REGEX "CGNS_DOTVERS") +- string(REGEX REPLACE ".*CGNS_DOTVERS *\([0-9.]*\).*" "\\1" CGNS_VERSION "${version}") +- unset(version) +-else () +- set(CGNS_VERSION CGNS_VERSION-NOTFOUND) +-endif () +- +-# handle the QUIETLY and REQUIRED arguments and set CGNS_FOUND to TRUE if +-# all listed variables are TRUE +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(CGNS +- REQUIRED_VARS CGNS_INCLUDE_DIR CGNS_LIBRARY +- VERSION_VAR CGNS_VERSION) +- +-if (CGNS_FOUND) +- set(CGNS_LIBRARIES "${CGNS_LIBRARY}") +- set(CGNS_INCLUDE_DIRS "${CGNS_INCLUDE_DIR}") +- if (NOT TARGET CGNS::CGNS) +- add_library(CGNS::CGNS UNKNOWN IMPORTED) +- set_target_properties(CGNS::CGNS PROPERTIES +- IMPORTED_LOCATION "${CGNS_LIBRARY}" +- INTERFACE_INCLUDE_DIRECTORIES "${CGNS_INCLUDE_DIR}") +- endif () +-endif () ++#
++# Find the native CGNS includes and library
++#
++# CGNS_INCLUDE_DIR - where to find cgns.h, etc.
++# CGNS_LIBRARIES - List of fully qualified libraries to link against when using CGNS.
++# CGNS_FOUND - Do not attempt to use CGNS if "no" or undefined.
++
++find_path(CGNS_INCLUDE_DIR
++ NAMES
++ cgnslib.h
++ PATHS
++ /usr/local/include
++ /usr/include
++ DOC "CGNS include directory")
++mark_as_advanced(CGNS_INCLUDE_DIR)
++
++find_library(CGNS_LIBRARY
++ NAMES
++ cgnsdll cgns
++ DOC "CGNS library")
++mark_as_advanced(CGNS_LIBRARY)
++
++if (CGNS_INCLUDE_DIR)
++ file(STRINGS "${CGNS_INCLUDE_DIR}/cgnslib.h" version
++ REGEX "CGNS_DOTVERS")
++ string(REGEX REPLACE ".*CGNS_DOTVERS *\([0-9.]*\).*" "\\1" CGNS_VERSION "${version}")
++ unset(version)
++else ()
++ set(CGNS_VERSION CGNS_VERSION-NOTFOUND)
++endif ()
++
++# handle the QUIETLY and REQUIRED arguments and set CGNS_FOUND to TRUE if
++# all listed variables are TRUE
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(CGNS
++ REQUIRED_VARS CGNS_INCLUDE_DIR CGNS_LIBRARY
++ VERSION_VAR CGNS_VERSION)
++
++if (CGNS_FOUND)
++ set(CGNS_LIBRARIES "${CGNS_LIBRARY}")
++ set(CGNS_INCLUDE_DIRS "${CGNS_INCLUDE_DIR}")
++ if (NOT TARGET CGNS::CGNS)
++ add_library(CGNS::CGNS UNKNOWN IMPORTED)
++ set_target_properties(CGNS::CGNS PROPERTIES
++ IMPORTED_LOCATION "${CGNS_LIBRARY}"
++ INTERFACE_INCLUDE_DIRECTORIES "${CGNS_INCLUDE_DIR}")
++ find_package(HDF5 REQUIRED)
++ if(TARGET HDF5::HDF5)
++ set_property(TARGET CGNS::CGNS APPEND PROPERTY
++ INTERFACE_LINK_LIBRARIES "HDF5::HDF5")
++ endif()
++ endif ()
++endif ()
diff --git a/vcpkg/ports/vtk/devendor_exodusII.patch b/vcpkg/ports/vtk/devendor_exodusII.patch new file mode 100644 index 0000000..aa37539 --- /dev/null +++ b/vcpkg/ports/vtk/devendor_exodusII.patch @@ -0,0 +1,70 @@ +diff --git a/ThirdParty/exodusII/CMakeLists.txt b/ThirdParty/exodusII/CMakeLists.txt +index 7a0cefb..3139114 100644 +--- a/ThirdParty/exodusII/CMakeLists.txt ++++ b/ThirdParty/exodusII/CMakeLists.txt +@@ -1,20 +1,27 @@ +-vtk_module_third_party_internal( +- LICENSE_FILES +- "vtkexodusII/COPYRIGHT" +- SPDX_LICENSE_IDENTIFIER +- "BSD-3-Clause" +- SPDX_COPYRIGHT_TEXT +- "Copyright (c) 2005-2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS)" +- SPDX_DOWNLOAD_LOCATION +- "git+https://gitlab.kitware.com/third-party/seacas.git@exodus/for/vtk-20220706-v2021-05-12#packages/seacas/libraries/exodus" +- VERSION +- "8.11f" +- STANDARD_INCLUDE_DIRS) ++vtk_module_third_party( ++ INTERNAL ++ LICENSE_FILES ++ "vtkexodusII/COPYRIGHT" ++ SPDX_LICENSE_IDENTIFIER ++ "BSD-3-Clause" ++ SPDX_COPYRIGHT_TEXT ++ "Copyright (c) 2005-2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS)" ++ SPDX_DOWNLOAD_LOCATION ++ "git+https://gitlab.kitware.com/third-party/seacas.git@exodus/for/vtk-20220706-v2021-05-12#packages/seacas/libraries/exodus" ++ VERSION ++ "8.11f" ++ STANDARD_INCLUDE_DIRS ++ EXTERNAL ++ PACKAGE SEACASExodus ++ CONFIG_MODE ++ TARGETS SEACASExodus::exodus ++ STANDARD_INCLUDE_DIRS ++) + +-#configure_file( +-# "${CMAKE_CURRENT_SOURCE_DIR}/vtk_exodusII.h.in" +-# "${CMAKE_CURRENT_BINARY_DIR}/vtk_exodusII.h") ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/vtk_exodusII.h.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/vtk_exodusII.h") + + vtk_module_install_headers( +-# FILES "${CMAKE_CURRENT_BINARY_DIR}/vtk_exodusII.h") +- FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtk_exodusII.h") ++ FILES "${CMAKE_CURRENT_BINARY_DIR}/vtk_exodusII.h") ++# FILES "${CMAKE_CURRENT_SOURCE_DIR}/vtk_exodusII.h") +diff --git a/ThirdParty/exodusII/vtk_exodusII.h.in b/ThirdParty/exodusII/vtk_exodusII.h.in +new file mode 100644 +index 0000000..ac2ab78 +--- /dev/null ++++ b/ThirdParty/exodusII/vtk_exodusII.h.in +@@ -0,0 +1,15 @@ ++// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen ++// SPDX-License-Identifier: BSD-3-Clause ++#ifndef vtk_exodusII_h ++#define vtk_exodusII_h ++ ++/* Use the libproj library configured for VTK. */ ++#cmakedefine01 VTK_MODULE_USE_EXTERNAL_vtkexodusII ++ ++#if VTK_MODULE_USE_EXTERNAL_vtkexodusII ++# include <exodusII.h> ++#else ++# include <vtkexodusII/include/exodusII.h> ++#endif ++ ++#endif diff --git a/vcpkg/ports/vtk/fast-float.patch b/vcpkg/ports/vtk/fast-float.patch new file mode 100644 index 0000000..1d12c0d --- /dev/null +++ b/vcpkg/ports/vtk/fast-float.patch @@ -0,0 +1,12 @@ +diff --git a/ThirdParty/fast_float/CMakeLists.txt b/ThirdParty/fast_float/CMakeLists.txt +index e6e63cbfe6..919b12a509 100644 +--- a/ThirdParty/fast_float/CMakeLists.txt ++++ b/ThirdParty/fast_float/CMakeLists.txt +@@ -13,7 +13,6 @@ vtk_module_third_party( + STANDARD_INCLUDE_DIRS + HEADER_ONLY + EXTERNAL +- VERSION "3.9.0" + PACKAGE FastFloat + TARGETS FastFloat::fast_float + STANDARD_INCLUDE_DIRS diff --git a/vcpkg/ports/vtk/ffmpeg.diff b/vcpkg/ports/vtk/ffmpeg.diff new file mode 100644 index 0000000..3c5a904 --- /dev/null +++ b/vcpkg/ports/vtk/ffmpeg.diff @@ -0,0 +1,47 @@ +diff --git a/CMake/FindFFMPEG.cmake b/CMake/FindFFMPEG.cmake +index f727ef2d..b5eae147 100644 +--- a/CMake/FindFFMPEG.cmake ++++ b/CMake/FindFFMPEG.cmake +@@ -79,16 +79,19 @@ function (_ffmpeg_find component headername) + set(_deps_found TRUE) + set(_deps_link) + foreach (_ffmpeg_dep IN LISTS ARGN) +- if (TARGET "FFMPEG::${_ffmpeg_dep}") +- list(APPEND _deps_link "FFMPEG::${_ffmpeg_dep}") ++ if (TARGET "FFmpeg::${_ffmpeg_dep}") ++ list(APPEND _deps_link "FFmpeg::${_ffmpeg_dep}") + else () + set(_deps_found FALSE) + endif () + endforeach () + if (_deps_found) +- if (NOT TARGET "FFMPEG::${component}") +- add_library("FFMPEG::${component}" UNKNOWN IMPORTED) +- set_target_properties("FFMPEG::${component}" PROPERTIES ++ if (NOT TARGET "FFmpeg::${component}") ++ # vcpkg cmake wrapper ++ add_library("FFmpeg::${component}" UNKNOWN IMPORTED) ++ # VTK ++ add_library("FFMPEG::${component}" ALIAS "FFmpeg::${component}") ++ set_target_properties("FFmpeg::${component}" PROPERTIES + IMPORTED_LOCATION "${FFMPEG_${component}_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_${component}_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LIBRARIES "${_deps_link}") +@@ -148,7 +151,7 @@ _ffmpeg_find(avfilter avfilter.h + _ffmpeg_find(avdevice avdevice.h + avformat avutil) + +-if (TARGET FFMPEG::avutil) ++if (TARGET FFmpeg::avutil) + set(_ffmpeg_version_header_path "${FFMPEG_avutil_INCLUDE_DIR}/libavutil/ffversion.h") + if (EXISTS "${_ffmpeg_version_header_path}") + file(STRINGS "${_ffmpeg_version_header_path}" _ffmpeg_version +@@ -165,7 +168,7 @@ set(FFMPEG_INCLUDE_DIRS) + set(FFMPEG_LIBRARIES) + set(_ffmpeg_required_vars) + foreach (_ffmpeg_component IN LISTS FFMPEG_FIND_COMPONENTS) +- if (TARGET "FFMPEG::${_ffmpeg_component}") ++ if (TARGET "FFmpeg::${_ffmpeg_component}") + set(FFMPEG_${_ffmpeg_component}_INCLUDE_DIRS + "${FFMPEG_${_ffmpeg_component}_INCLUDE_DIR}") + set(FFMPEG_${_ffmpeg_component}_LIBRARIES diff --git a/vcpkg/ports/vtk/fix-exprtk.patch b/vcpkg/ports/vtk/fix-exprtk.patch new file mode 100644 index 0000000..8b5e72e --- /dev/null +++ b/vcpkg/ports/vtk/fix-exprtk.patch @@ -0,0 +1,13 @@ +diff --git a/CMake/FindExprTk.cmake b/CMake/FindExprTk.cmake +index 2886e7ed71..cb8a875725 100644 +--- a/CMake/FindExprTk.cmake ++++ b/CMake/FindExprTk.cmake +@@ -24,7 +24,7 @@ if (ExprTk_INCLUDE_DIR) + set(ExprTk_VERSION) + foreach (_exprtk_version_line IN LISTS _exprtk_version_header) + if ("${ExprTk_VERSION}" STREQUAL "") +- string(REGEX MATCH "version = \"(2\.7[0-9.]+)\".*$" _exprtk_version_match "${_exprtk_version_line}") ++ string(REGEX MATCH [[version = "(2\.7[0-9.]+)".*$]] _exprtk_version_match "${_exprtk_version_line}") + set(ExprTk_VERSION "${CMAKE_MATCH_1}") + else () + string(REGEX MATCH "\"([0-9.]+)\".*$" _exprtk_version_match "${_exprtk_version_line}") diff --git a/vcpkg/ports/vtk/fix-gdal.patch b/vcpkg/ports/vtk/fix-gdal.patch new file mode 100644 index 0000000..9a249ef --- /dev/null +++ b/vcpkg/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/vcpkg/ports/vtk/fix-tbbsmptool.patch b/vcpkg/ports/vtk/fix-tbbsmptool.patch new file mode 100644 index 0000000..a7a3ce0 --- /dev/null +++ b/vcpkg/ports/vtk/fix-tbbsmptool.patch @@ -0,0 +1,15 @@ +diff --git a/Common/Core/SMP/TBB/vtkSMPToolsImpl.txx b/Common/Core/SMP/TBB/vtkSMPToolsImpl.txx +index e5792ee..e81d5ed 100644 +--- a/Common/Core/SMP/TBB/vtkSMPToolsImpl.txx ++++ b/Common/Core/SMP/TBB/vtkSMPToolsImpl.txx +@@ -190,6 +190,10 @@ int vtkSMPToolsImpl<BackendType::TBB>::GetEstimatedNumberOfThreads(); + template <> + bool vtkSMPToolsImpl<BackendType::TBB>::GetSingleThread(); + ++//-------------------------------------------------------------------------------- ++template <> ++VTKCOMMONCORE_EXPORT vtkSMPToolsImpl<BackendType::TBB>::vtkSMPToolsImpl(); ++ + VTK_ABI_NAMESPACE_END + } // namespace smp + } // namespace detail diff --git a/vcpkg/ports/vtk/fix-using-hdf5.patch b/vcpkg/ports/vtk/fix-using-hdf5.patch new file mode 100644 index 0000000..834ab15 --- /dev/null +++ b/vcpkg/ports/vtk/fix-using-hdf5.patch @@ -0,0 +1,22 @@ +diff --git a/ThirdParty/h5part/vtkh5part/src/H5Part.c b/ThirdParty/h5part/vtkh5part/src/H5Part.c +index 228d246..41af04d 100644 +--- a/ThirdParty/h5part/vtkh5part/src/H5Part.c ++++ b/ThirdParty/h5part/vtkh5part/src/H5Part.c +@@ -2092,7 +2092,7 @@ _H5Part_iteration_operator2 ( + case H5L_TYPE_HARD: { + + H5O_info_t objinfo; +- if( H5Oget_info_by_name( group_id, member_name, &objinfo, H5P_DEFAULT ) < 0 ) { ++ if( H5Oget_info_by_name1( group_id, member_name, &objinfo, H5P_DEFAULT ) < 0 ) { + return (herr_t)HANDLE_H5G_GET_OBJINFO_ERR ( member_name ); + } + +@@ -2142,7 +2142,7 @@ _H5Part_iteration_operator2 ( + if ( obj_id < 0 ) { + return (herr_t)HANDLE_H5G_OPEN_ERR ( member_name ); + } +- else if ( H5Oget_info ( obj_id, &objinfo ) < 0 ) { ++ else if ( H5Oget_info1 ( obj_id, &objinfo ) < 0 ) { + return (herr_t)HANDLE_H5G_GET_OBJINFO_ERR ( member_name ); + } + else { diff --git a/vcpkg/ports/vtk/hdf5helper.patch b/vcpkg/ports/vtk/hdf5helper.patch new file mode 100644 index 0000000..e7c32ce --- /dev/null +++ b/vcpkg/ports/vtk/hdf5helper.patch @@ -0,0 +1,11 @@ +--- src/IO/ERF/vtkHDF5Helper.h.old 2024-02-27 17:35:26.000000000 +0100 ++++ src/IO/ERF/vtkHDF5Helper.h 2024-05-02 15:49:35.716258500 +0200 +@@ -42,7 +42,7 @@ public: + /** + * Check existence of group defined by groupName relative to fileId. + */ +- static bool GroupExists(int64_t fileId, const char* groupName); ++ static bool GroupExists(hid_t fileId, const char* groupName); + + /** + * Get length of array defined by arrayId. diff --git a/vcpkg/ports/vtk/iotr.patch b/vcpkg/ports/vtk/iotr.patch new file mode 100644 index 0000000..a7f9f1b --- /dev/null +++ b/vcpkg/ports/vtk/iotr.patch @@ -0,0 +1,26 @@ +diff --git a/IO/IOSS/vtkIOSSUtilities.cxx b/IO/IOSS/vtkIOSSUtilities.cxx +index 26470b965..bee76107a 100644 +--- a/IO/IOSS/vtkIOSSUtilities.cxx ++++ b/IO/IOSS/vtkIOSSUtilities.cxx +@@ -38,6 +38,7 @@ + #include <Ioss_NodeBlock.h> + #include <Ioss_SideBlock.h> + #include <Ioss_SideSet.h> ++#include <Iotr_Factory.h> + + #include <memory> + +diff --git a/IO/IOSS/vtkIOSSReaderInternal.cxx b/IO/IOSS/vtkIOSSReaderInternal.cxx +index de8d456..237644b 100644 +--- a/IO/IOSS/vtkIOSSReaderInternal.cxx ++++ b/IO/IOSS/vtkIOSSReaderInternal.cxx +@@ -9,6 +9,8 @@ + #include "vtkIOSSReaderCommunication.h" + #include "vtkIOSSUtilities.h" + ++#include VTK_IOSS(Iotr_Factory.h) ++ + #include "vtkCellArrayIterator.h" + #include "vtkCellData.h" + #include "vtkDataArraySelection.h" + diff --git a/vcpkg/ports/vtk/jsoncpp.patch b/vcpkg/ports/vtk/jsoncpp.patch new file mode 100644 index 0000000..e92acb9 --- /dev/null +++ b/vcpkg/ports/vtk/jsoncpp.patch @@ -0,0 +1,12 @@ +diff --git a/ThirdParty/jsoncpp/CMakeLists.txt b/ThirdParty/jsoncpp/CMakeLists.txt
+index a9581f862..ad17b7323 100644
+--- a/ThirdParty/jsoncpp/CMakeLists.txt
++++ b/ThirdParty/jsoncpp/CMakeLists.txt
+@@ -8,7 +8,6 @@ vtk_module_third_party(
+ VERSION "1.9.4"
+ STANDARD_INCLUDE_DIRS
+ EXTERNAL
+ PACKAGE JsonCpp
+- VERSION 0.7.0
+ TARGETS JsonCpp::JsonCpp
+ STANDARD_INCLUDE_DIRS)
diff --git a/vcpkg/ports/vtk/libproj.patch b/vcpkg/ports/vtk/libproj.patch new file mode 100644 index 0000000..7b97297 --- /dev/null +++ b/vcpkg/ports/vtk/libproj.patch @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d477f8b..375a2a2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -389,7 +389,6 @@ endif () + # Handle the requirement of `sqlitebin` for `proj`. + set(vtk_sqlite_build_binary 0) + if ("VTK::libproj" IN_LIST vtk_modules) +- set(vtk_sqlite_build_binary 1) + endif () + + cmake_dependent_option(VTK_ENABLE_KITS "Enable kits compilation" OFF +diff --git a/ThirdParty/libproj/CMakeLists.txt b/ThirdParty/libproj/CMakeLists.txt +index f8888876..d57c4c18 100644 +--- a/ThirdParty/libproj/CMakeLists.txt ++++ b/ThirdParty/libproj/CMakeLists.txt +@@ -4,11 +4,13 @@ vtk_module_third_party( + VERSION + "8.1.0" + STANDARD_INCLUDE_DIRS + EXTERNAL +- PACKAGE LibPROJ +- TARGETS LibPROJ::LibPROJ +- USE_VARIABLES LibPROJ_MAJOR_VERSION ++ PACKAGE PROJ ++ CONFIG_MODE ++ TARGETS PROJ::proj ++ USE_VARIABLES PROJ_VERSION_MAJOR + STANDARD_INCLUDE_DIRS) ++set(LibPROJ_MAJOR_VERSION "${PROJ_VERSION_MAJOR}") + + if (NOT VTK_MODULE_USE_EXTERNAL_VTK_libproj) + set(LibPROJ_MAJOR_VERSION "8") +diff --git a/ThirdParty/libproj/vtk.module b/ThirdParty/libproj/vtk.module +index e49d988f..bb2d22e7 100644 +--- a/ThirdParty/libproj/vtk.module ++++ b/ThirdParty/libproj/vtk.module +@@ -6,8 +6,4 @@ SPDX_LICENSE_IDENTIFIER + BSD-3-Clause + SPDX_COPYRIGHT_TEXT + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen +-DEPENDS +- VTK::nlohmannjson +-PRIVATE_DEPENDS +- VTK::sqlite + THIRD_PARTY diff --git a/vcpkg/ports/vtk/mysql.diff b/vcpkg/ports/vtk/mysql.diff new file mode 100644 index 0000000..9dc8346 --- /dev/null +++ b/vcpkg/ports/vtk/mysql.diff @@ -0,0 +1,50 @@ +diff --git a/CMake/FindMySQL.cmake b/CMake/FindMySQL.cmake +index cc0679b..330326c 100644 +--- a/CMake/FindMySQL.cmake ++++ b/CMake/FindMySQL.cmake +@@ -1,3 +1,5 @@ ++ ++if(0) + #[==[ + Provides the following variables: + +@@ -110,3 +112,10 @@ else () + endif () + endif () + unset(_MySQL_use_pkgconfig) ++endif() ++ ++if(NOT TARGET MySQL::MySQL) ++ find_package(MySQL NAMES unofficial-libmysql REQUIRED) ++ add_library(MySQL::MySQL INTERFACE IMPORTED) ++ target_link_libraries(MySQL::MySQL INTERFACE unofficial::libmysql::libmysql) ++endif() +diff --git a/IO/MySQL/vtkMySQLDatabasePrivate.h b/IO/MySQL/vtkMySQLDatabasePrivate.h +index 82bc5c5..76256bc 100644 +--- a/IO/MySQL/vtkMySQLDatabasePrivate.h ++++ b/IO/MySQL/vtkMySQLDatabasePrivate.h +@@ -8,7 +8,8 @@ + #endif + + #include "vtkIOMySQLModule.h" // For export macro +-#include <mysql.h> // needed for MYSQL typedefs ++#include <mysql/mysql.h> // needed for MYSQL typedefs ++using my_bool = bool; // removed in libmysql 8.0 + + VTK_ABI_NAMESPACE_BEGIN + class VTKIOMYSQL_EXPORT vtkMySQLDatabasePrivate +diff --git a/IO/MySQL/vtkMySQLQuery.cxx b/IO/MySQL/vtkMySQLQuery.cxx +index 38a9ec9..c5cc785 100644 +--- a/IO/MySQL/vtkMySQLQuery.cxx ++++ b/IO/MySQL/vtkMySQLQuery.cxx +@@ -9,8 +9,8 @@ + #include "vtkVariant.h" + #include "vtkVariantArray.h" + +-#include <errmsg.h> +-#include <mysql.h> ++#include <mysql/errmsg.h> ++#include <mysql/mysql.h> + + #if defined(_WIN32) + #include <locale.h> diff --git a/vcpkg/ports/vtk/no-libharu-for-ioexport.patch b/vcpkg/ports/vtk/no-libharu-for-ioexport.patch new file mode 100644 index 0000000..1a659d1 --- /dev/null +++ b/vcpkg/ports/vtk/no-libharu-for-ioexport.patch @@ -0,0 +1,12 @@ +diff --git a/IO/Export/vtk.module b/IO/Export/vtk.module +index 01b18a48..dcac24c0 100644 +--- a/IO/Export/vtk.module ++++ b/IO/Export/vtk.module +@@ -36,7 +36,6 @@ PRIVATE_DEPENDS + VTK::IOGeometry + VTK::ImagingCore + VTK::nlohmannjson +- VTK::libharu + VTK::utf8 + TEST_DEPENDS + VTK::ChartsCore diff --git a/vcpkg/ports/vtk/no-libproj-for-netcdf.patch b/vcpkg/ports/vtk/no-libproj-for-netcdf.patch new file mode 100644 index 0000000..e7f1085 --- /dev/null +++ b/vcpkg/ports/vtk/no-libproj-for-netcdf.patch @@ -0,0 +1,24 @@ +diff --git a/IO/NetCDF/vtk.module b/IO/NetCDF/vtk.module +index a0cc0741..07f3606b 100644 +--- a/IO/NetCDF/vtk.module ++++ b/IO/NetCDF/vtk.module +@@ -26,7 +26,6 @@ PRIVATE_DEPENDS + VTK::CommonDataModel + VTK::netcdf + VTK::vtksys +- VTK::libproj + TEST_DEPENDS + VTK::CommonExecutionModel + VTK::FiltersGeometry +diff --git a/IO/NetCDF/vtkNetCDFCFWriter.cxx b/IO/NetCDF/vtkNetCDFCFWriter.cxx +index 756ff87..d71de89 100644 +--- a/IO/NetCDF/vtkNetCDFCFWriter.cxx ++++ b/IO/NetCDF/vtkNetCDFCFWriter.cxx +@@ -33,7 +33,6 @@ + #include <sstream> + #include <vector> + +-#include "vtk_libproj.h" + #include "vtk_netcdf.h" + + VTK_ABI_NAMESPACE_BEGIN diff --git a/vcpkg/ports/vtk/octree.patch b/vcpkg/ports/vtk/octree.patch new file mode 100644 index 0000000..281aec7 --- /dev/null +++ b/vcpkg/ports/vtk/octree.patch @@ -0,0 +1,13 @@ +diff --git a/Utilities/octree/octree/octree_node.txx b/Utilities/octree/octree/octree_node.txx +index 6971c7c119..5f12bb7de7 100644 +--- a/Utilities/octree/octree/octree_node.txx ++++ b/Utilities/octree/octree/octree_node.txx +@@ -210,7 +210,7 @@ const octree_node<T_, d_, A_>& octree_node<T_, d_, A_>::operator[](int child) co + { + throw std::domain_error("Attempt to access children of an octree leaf node."); + } +- return this->_M_chilren[child]; ++ return this->m_children[child]; + } + + /**\brief Return a reference to a child node. diff --git a/vcpkg/ports/vtk/opencascade-7.8.0.patch b/vcpkg/ports/vtk/opencascade-7.8.0.patch new file mode 100644 index 0000000..3a78b0a --- /dev/null +++ b/vcpkg/ports/vtk/opencascade-7.8.0.patch @@ -0,0 +1,83 @@ +diff --git a/IO/OCCT/CMakeLists.txt b/IO/OCCT/CMakeLists.txt +index e81444eceb..4baddeb719 100644 +--- a/IO/OCCT/CMakeLists.txt ++++ b/IO/OCCT/CMakeLists.txt +@@ -4,12 +4,25 @@ vtk_module_find_package(PRIVATE_IF_SHARED + VERSION_VAR "@OpenCASCADE_MAJOR_VERSION@.@OpenCASCADE_MINOR_VERSION@.@OpenCASCADE_MAINTENANCE_VERSION@" + ) + +-set(opencascade_req_targets +- TKSTEP +- TKIGES +- TKMesh +- TKXDESTEP +- TKXDEIGES) ++if (OpenCASCADE_VERSION VERSION_GREATER_EQUAL "7.8.0") ++ set(opencascade_req_targets ++ TKDESTEP ++ TKDEIGES ++ TKernel ++ TKMath ++ TKMesh ++ TKBRep ++ TKXSBase ++ TKLCAF ++ TKXCAF) ++else() ++ set(opencascade_req_targets ++ TKSTEP ++ TKIGES ++ TKMesh ++ TKXDESTEP ++ TKXDEIGES) ++endif() + set(opencascade_missing_targets) + foreach (opencascade_req_target IN LISTS opencascade_req_targets) + if (NOT TARGET "${opencascade_req_target}") +@@ -35,8 +48,7 @@ vtk_module_link(VTK::IOOCCT + ${opencascade_req_targets}) + + # OpenCASCADE started putting include directory usage requirements in 7.7.0. +-set(OpenCASCADE_VERSION +- "${OpenCASCADE_MAJOR_VERSION}.${OpenCASCADE_MINOR_VERSION}.${OpenCASCADE_MAINTENANCE_VERSION}") ++ + if (OpenCASCADE_VERSION VERSION_LESS "7.7.0") + vtk_module_include(VTK::IOOCCT PRIVATE "${OpenCASCADE_INCLUDE_DIR}") + endif () +diff --git a/IO/OCCT/vtkOCCTReader.cxx b/IO/OCCT/vtkOCCTReader.cxx +index 52e76be72c..5aca5c93c8 100644 +--- a/IO/OCCT/vtkOCCTReader.cxx ++++ b/IO/OCCT/vtkOCCTReader.cxx +@@ -345,11 +345,19 @@ public: + } + + //---------------------------------------------------------------------------- ++#if VTK_OCCT_VERSION(7, 8, 0) <= OCC_VERSION_HEX ++ size_t GetHash(const TDF_Label& label) ++ { ++ TopoDS_Shape aShape; ++ return this->ShapeTool->GetShape(label, aShape) ? std::hash<TopoDS_Shape>{}(aShape) : 0; ++ } ++#else + int GetHash(const TDF_Label& label) + { + TopoDS_Shape aShape; + return this->ShapeTool->GetShape(label, aShape) ? aShape.HashCode(INT_MAX) : 0; + } ++#endif + + //---------------------------------------------------------------------------- + static void GetMatrix(const TopLoc_Location& loc, vtkMatrix4x4* mat) +@@ -381,8 +389,11 @@ public: + GetMatrix(hLoc->Get(), location); + } + } +- ++#if VTK_OCCT_VERSION(7, 8, 0) <= OCC_VERSION_HEX ++ std::unordered_map<size_t, vtkSmartPointer<vtkPolyData>> ShapeMap; ++#else + std::unordered_map<int, vtkSmartPointer<vtkPolyData>> ShapeMap; ++#endif + Handle(XCAFDoc_ShapeTool) ShapeTool; + Handle(XCAFDoc_ColorTool) ColorTool; + diff --git a/vcpkg/ports/vtk/pegtl.patch b/vcpkg/ports/vtk/pegtl.patch new file mode 100644 index 0000000..912549d --- /dev/null +++ b/vcpkg/ports/vtk/pegtl.patch @@ -0,0 +1,108 @@ +diff --git a/IO/MotionFX/vtkMotionFXCFGGrammar.h b/IO/MotionFX/vtkMotionFXCFGGrammar.h
+index dba137386..4cb03e054 100644
+--- a/IO/MotionFX/vtkMotionFXCFGGrammar.h
++++ b/IO/MotionFX/vtkMotionFXCFGGrammar.h
+@@ -23,7 +23,7 @@
+
+ // for debugging
+ // clang-format off
+-#include VTK_PEGTL(pegtl/contrib/tracer.hpp)
++#include VTK_PEGTL(pegtl/contrib/trace.hpp)
+ // clang-format on
+
+ namespace MotionFX
+diff --git a/IO/MotionFX/vtkMotionFXCFGReader.cxx b/IO/MotionFX/vtkMotionFXCFGReader.cxx
+index 338aa736e..374e54b94 100644
+--- a/IO/MotionFX/vtkMotionFXCFGReader.cxx
++++ b/IO/MotionFX/vtkMotionFXCFGReader.cxx
+@@ -1213,7 +1213,7 @@ bool PositionFileMotion::read_position_file(const std::string& rootDir) const
+ }
+ return true;
+ }
+- catch (const tao::pegtl::input_error& e)
++ catch (const tao::pegtl::parse_error& e)
+ {
+ vtkGenericWarningMacro("PositionFileMotion::read_position_file failed: " << e.what());
+ }
+@@ -1232,7 +1232,7 @@ bool UniversalTransformMotion::read_universaltransform_file(const std::string& r
+ in, numbers, this->transforms);
+ return true;
+ }
+- catch (const tao::pegtl::input_error& e)
++ catch (const tao::pegtl::parse_error& e)
+ {
+ vtkGenericWarningMacro(
+ "UniversalTransformMotion::read_universaltransform_file failed: " << e.what());
+@@ -1267,7 +1267,7 @@ public:
+ if (getenv("MOTIONFX_DEBUG_GRAMMAR") != nullptr)
+ {
+ tao::pegtl::read_input<> in2(filename);
+- tao::pegtl::parse<MotionFX::CFG::Grammar, tao::pegtl::nothing, tao::pegtl::tracer>(in2);
++ tao::pegtl::complete_trace<MotionFX::CFG::Grammar>(in2);
+ }
+ return false;
+ }
+diff --git a/ThirdParty/pegtl/CMakeLists.txt b/ThirdParty/pegtl/CMakeLists.txt
+index 9bbd4c828..0cdb1f53d 100644
+--- a/ThirdParty/pegtl/CMakeLists.txt
++++ b/ThirdParty/pegtl/CMakeLists.txt
+@@ -5,8 +5,7 @@ vtk_module_third_party(
+ VERSION
+ "2.8.3"
+ EXTERNAL
+ PACKAGE PEGTL
+- VERSION 2.0.0
+ TARGETS PEGTL::PEGTL
+ STANDARD_INCLUDE_DIRS)
+
+diff --git a/CMake/FindPEGTL.cmake b/CMake/FindPEGTL.cmake
+index 73eee02f7..22d8bc159 100644
+--- a/CMake/FindPEGTL.cmake
++++ b/CMake/FindPEGTL.cmake
+@@ -19,31 +19,45 @@
+ #
+ # PEGTL::PEGTL
+
++message(STATUS "Searching for PEGTL")
++find_package(PEGTL CONFIG REQUIRED)
++if(TARGET taocpp::pegtl)
++ message(STATUS "Searching for PEGTL - found target taocpp::pegtl")
++ get_target_property(TARGET_IMPORTED_GLOBAL taocpp::pegtl IMPORTED_GLOBAL)
++ if(NOT TARGET_IMPORTED_GLOBAL)
++ set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE)
++ endif()
++ if(NOT TARGET PEGTL::PEGTL)
++ add_library(PEGTL::PEGTL IMPORTED INTERFACE)
++ target_link_libraries(PEGTL::PEGTL INTERFACE taocpp::pegtl)
++ endif()
++else()
+ find_path(PEGTL_INCLUDE_DIR
+ NAMES pegtl/version.hpp
+ PATH_SUFFIXES tao
+ DOC "Path to PEGTL headers")
+ mark_as_advanced(PEGTL_INCLUDE_DIR)
+
+ if (PEGTL_INCLUDE_DIR)
+ file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header
+ REGEX "TAO_PEGTL_VERSION")
+ string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}")
+ set(PEGTL_VERSION "${CMAKE_MATCH_1}")
+ unset(_pegtl_version_header)
+ unset(_pegtl_version_match)
+ endif ()
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(PEGTL
+ REQUIRED_VARS PEGTL_INCLUDE_DIR
+ VERSION_VAR PEGTL_VERSION)
+
+ if (PEGTL_FOUND)
+ set(PEGTL_INCLUDE_DIRS "${PEGTL_INCLUDE_DIR}")
+ if (NOT TARGET PEGTL::PEGTL)
+ add_library(PEGTL::PEGTL INTERFACE IMPORTED)
+ set_target_properties(PEGTL::PEGTL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${PEGTL_INCLUDE_DIR}")
+ endif ()
+ endif ()
++endif ()
+
diff --git a/vcpkg/ports/vtk/portfile.cmake b/vcpkg/ports/vtk/portfile.cmake new file mode 100644 index 0000000..6479057 --- /dev/null +++ b/vcpkg/ports/vtk/portfile.cmake @@ -0,0 +1,453 @@ +set(VTK_SHORT_VERSION 9.3) +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() + +set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled) + +# ============================================================================= +# Clone & patch +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Kitware/VTK + REF 09a76bc55b37caad94d0d8ebe865caaed1b438af # v9.3.x used by ParaView 5.12.0 + SHA512 396ee901fafacae8aef860b9c9c17cb92ae8b4969527fd271ad8dd9f6a9e0dc8e3dc807c8d43cc585608ad101a64edcd7aff49e1580c7a61a817c2ea8e2655f5 + HEAD_REF master + PATCHES + ffmpeg.diff + FindLZMA.patch + FindLZ4.patch + libproj.patch + mysql.diff + pegtl.patch + pythonwrapper.patch # Required by ParaView to Wrap required classes + NoUndefDebug.patch # Required to link against correct Python library depending on build type. + 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 + # fix-gdal.patch TODO? + cgns.patch + vtkm.patch + afxdll.patch + vtkioss.patch + jsoncpp.patch + iotr.patch + fast-float.patch + fix-exprtk.patch # just for dbow2 and theia + devendor_exodusII.patch + remove-prefix-changes.patch + hdf5helper.patch + opencascade-7.8.0.patch + no-libharu-for-ioexport.patch + no-libproj-for-netcdf.patch + octree.patch + fix-tbbsmptool.patch # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11530 + backport-bda8324.diff # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12418 + use-compile-tools.diff + zspace.diff # https://gitlab.kitware.com/vtk/vtk/-/commit/01a8bd7a917d33892f67a8d76ce7fc4b524d56b4 +) + +# ============================================================================= +#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 + +file(REMOVE "${SOURCE_PATH}/CMake/FindOGG.cmake") +vcpkg_replace_string("${SOURCE_PATH}/ThirdParty/ogg/CMakeLists.txt" "OGG::OGG" "Ogg::ogg") +vcpkg_replace_string("${SOURCE_PATH}/ThirdParty/ogg/CMakeLists.txt" "OGG" "Ogg") +vcpkg_replace_string("${SOURCE_PATH}/CMake/vtkInstallCMakePackage.cmake" "FindOGG.cmake\n" "") +vcpkg_replace_string("${SOURCE_PATH}/CMake/FindTHEORA.cmake" "find_dependency(OGG)" "find_dependency(Ogg CONFIG)") +vcpkg_replace_string("${SOURCE_PATH}/CMake/FindTHEORA.cmake" "OGG::OGG" "Ogg::ogg") + +# ============================================================================= + +# ============================================================================= +# Options: +# Collect CMake options for optional components + +# Strict wiring of features/dependencies to VTK modules +# VTK_MODULE_ENABLE... and VTK_GROUP_ENABLE... do not use ON/OFF but +# VTK's special NO/DONT_WANT/WANT/YES/DEFAULT (cf. vtkModule.cmake). +# This section produces either YES or NO (after postprocessing). +# YES/NO are also okay for regular CMake options instead of ON/OFF, +# so we can consolidate VTK and CMake settings here. +vcpkg_check_features(OUT_FEATURE_OPTIONS VTK_YES_NO_OPTIONS + FEATURES + "all" VTK_BUILD_ALL_MODULES + "atlmfc" VTK_MODULE_ENABLE_VTK_GUISupportMFC + "cgns" VCPKG_LOCK_FIND_PACKAGE_CGNS + "cuda" VTK_USE_CUDA + "debugleaks" VTK_DEBUG_LEAKS + "fontconfig" VTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig + "libharu" VCPKG_LOCK_FIND_PACKAGE_LibHaru + "libtheora" VCPKG_LOCK_FIND_PACKAGE_THEORA + "netcdf" VCPKG_LOCK_FIND_PACKAGE_NetCDF + "netcdf" VTK_MODULE_ENABLE_VTK_netcdf + "netcdf" VTK_MODULE_ENABLE_VTK_IOMINC + "netcdf" VTK_MODULE_ENABLE_VTK_IONetCDF + "openmp" VTK_SMP_ENABLE_OPENMP + "proj" VCPKG_LOCK_FIND_PACKAGE_PROJ + "proj" VTK_MODULE_ENABLE_VTK_libproj + "proj" VTK_MODULE_ENABLE_VTK_IOCesium3DTiles + "proj" VTK_MODULE_ENABLE_VTK_GeovisCore + "python" VTK_WRAP_PYTHON + "python" VTK_MODULE_ENABLE_VTK_Python + "python" VTK_MODULE_ENABLE_VTK_PythonContext2D + "python" VTK_MODULE_ENABLE_VTK_PythonInterpreter + "seacas" VCPKG_LOCK_FIND_PACKAGE_SEACASExodus + "seacas" VCPKG_LOCK_FIND_PACKAGE_SEACASIoss + "sql" VCPKG_LOCK_FIND_PACKAGE_SQLite3 + "sql" VTK_MODULE_ENABLE_VTK_sqlite + "sql" VTK_MODULE_ENABLE_VTK_IOSQL + "tbb" VTK_SMP_ENABLE_TBB + "vtkm" VTK_MODULE_ENABLE_VTK_vtkm + "vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmCore + "vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmDataModel + "vtkm" VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters + INVERTED_FEATURES + "all" VTK_FORBID_DOWNLOADS +) +list(TRANSFORM VTK_YES_NO_OPTIONS REPLACE "=ON" "=YES") +list(TRANSFORM VTK_YES_NO_OPTIONS REPLACE "=OFF" "=NO") + +# 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 + "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_IOH5Rage + "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 + "paraview" VTK_MODULE_ENABLE_VTK_cli11 + "paraview" VTK_MODULE_ENABLE_VTK_FiltersOpenTURNS + "paraview" VTK_MODULE_ENABLE_VTK_FiltersParallelVerdict + "paraview" VTK_MODULE_ENABLE_VTK_IOOMF + "paraview" VTK_MODULE_ENABLE_VTK_IOPIO + "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 + "ioocct" VTK_MODULE_ENABLE_VTK_IOOCCT + "libtheora" VTK_MODULE_ENABLE_VTK_IOOggTheora + "libharu" VTK_MODULE_ENABLE_VTK_IOExportPDF + "cgns" VTK_MODULE_ENABLE_VTK_IOCGNSReader + "seacas" VTK_MODULE_ENABLE_VTK_IOIOSS + "seacas" VTK_MODULE_ENABLE_VTK_IOExodus +) +# Replace common value to vtk value +list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=ON" "=YES") +list(TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=OFF" "=DONT_WANT") + +if("qt" IN_LIST FEATURES) + file(READ "${CURRENT_INSTALLED_DIR}/share/qtbase/vcpkg_abi_info.txt" qtbase_abi_info) + if(qtbase_abi_info MATCHES "(^|;)gles2(;|$)") + message(FATAL_ERROR "VTK assumes qt to be build with desktop opengl. As such trying to build vtk with qt using GLES will fail.") + # This should really be a configure error but using this approach doesn't require patching. + endif() + + if(NOT EXISTS "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/qmlplugindump${VCPKG_HOST_EXECUTABLE_SUFFIX}") + list(APPEND VTK_FEATURE_OPTIONS -DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick=NO) + endif() +endif() + +if("python" IN_LIST FEATURES) + vcpkg_get_vcpkg_installed_python(PYTHON3) + list(APPEND ADDITIONAL_OPTIONS + -DPython3_FIND_REGISTRY=NEVER + "-DPython3_EXECUTABLE:PATH=${PYTHON3}" + "-DVTK_PYTHON_SITE_PACKAGES_SUFFIX=${PYTHON3_SITE}" # from vcpkg-port-config.cmake + ) + #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages +endif() + +if ("paraview" IN_LIST FEATURES OR "opengl" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_RenderingAnnotation=YES + -DVTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2=YES + -DVTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=YES + ) +endif() + +if ("paraview" IN_LIST FEATURES AND "python" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_WebCore=YES + -DVTK_MODULE_ENABLE_VTK_WebPython=YES + -DVTK_MODULE_ENABLE_VTK_RenderingMatplotlib=YES + ) +endif() + +set(use_mpi OFF) +if("mpi" IN_LIST FEATURES) + set(use_mpi ON) +elseif(HDF5_WITH_PARALLEL) + message(WARNING "${HDF5_WITH_PARALLEL} Enabling VTK MPI.") + set(use_mpi ON) +endif() +list(APPEND ADDITIONAL_OPTIONS -DVTK_USE_MPI=${use_mpi}) +if(use_mpi) + list(APPEND ADDITIONAL_OPTIONS -DVTK_MODULE_ENABLE_VTK_ParallelMPI=YES) + + if("paraview" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_FiltersParallelFlowPaths=YES + -DVTK_MODULE_ENABLE_VTK_RenderingParallelLIC=YES + ) + endif() + + if("python" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=OFF + ) + endif() +endif() + +if("cuda" IN_LIST FEATURES) + vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT cuda_toolkit_root) + list(APPEND ADDITIONAL_OPTIONS + "-DCMAKE_CUDA_COMPILER=${NVCC}" + ) +endif() + +if("utf8" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_UTF8 + ) +endif() + +if("tbb" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_SMP_IMPLEMENTATION_TYPE=TBB + ) +endif() + +if("openmp" IN_LIST FEATURES) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_SMP_IMPLEMENTATION_TYPE=OpenMP + ) +endif() + +if(NOT VCPKG_TARGET_IS_WINDOWS) + list(APPEND ADDITIONAL_OPTIONS + -DVTK_MODULE_ENABLE_VTK_IOODBC=NO + ) +endif() + +# ============================================================================= +# 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 + ${VTK_FEATURE_OPTIONS} + ${VTK_YES_NO_OPTIONS} + ${ADDITIONAL_OPTIONS} + -DBUILD_TESTING=OFF + -DVTK_BUILD_TESTING=OFF + -DVTK_BUILD_EXAMPLES=OFF + -DVTK_ENABLE_REMOTE_MODULES=OFF + # VTK groups to enable + -DVTK_GROUP_ENABLE_StandAlone=YES + -DVTK_GROUP_ENABLE_Rendering=YES + -DVTK_GROUP_ENABLE_Views=YES + # Disable dependencies which are not in vcpkg or not in the manifest + -DVCPKG_LOCK_FIND_PACKAGE_Boost=OFF + -DVTK_ENABLE_OSPRAY=OFF + -DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg + # Select modules / groups to install + -DVTK_USE_EXTERNAL:BOOL=ON + -DVTK_MODULE_ENABLE_VTK_CommonArchive=NO + -DVTK_MODULE_ENABLE_VTK_DomainsMicroscopy=NO + -DVTK_MODULE_ENABLE_VTK_fides=NO + -DVTK_MODULE_ENABLE_VTK_FiltersReebGraph=NO + -DVTK_MODULE_ENABLE_VTK_InfovisBoost=NO + -DVTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms=NO + -DVTK_MODULE_ENABLE_VTK_IOADIOS2=NO + -DVTK_MODULE_ENABLE_VTK_IOAlembic=NO + -DVTK_MODULE_ENABLE_VTK_IOLAS=NO + -DVTK_MODULE_ENABLE_VTK_IOOpenVDB=NO + -DVTK_MODULE_ENABLE_VTK_IOPDAL=NO + -DVTK_MODULE_ENABLE_VTK_RenderingOpenXR=NO + -DVTK_MODULE_ENABLE_VTK_WrappingTools=YES + -DVTK_MODULE_ENABLE_VTK_xdmf3=NO + -DVTK_MODULE_USE_EXTERNAL_VTK_token:BOOL=OFF # Not yet in VCPKG + # misc + -DVTK_DEBUG_MODULE_ALL=ON + -DVTK_DEBUG_MODULE=ON + -DVTK_QT_VERSION=6 + -DCMAKE_INSTALL_QMLDIR:PATH=qml + "-DVTKCompileTools_DIR=${CURRENT_HOST_INSTALLED_DIR}/share/vtk-compile-tools" + -DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET} + -DCMAKE_POLICY_DEFAULT_CMP0174=NEW # cmake_parse_arguments + -DCMAKE_POLICY_DEFAULT_CMP0177=NEW # install() DESTINATION paths are normalized + -DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON # Due to Qt6::Platform not being found on Linux platform + MAYBE_UNUSED_VARIABLES + VTK_ENABLE_OSPRAY + VTK_MODULE_ENABLE_VTK_PythonContext2D # Guarded by a conditional + VTK_MODULE_ENABLE_VTK_GUISupportMFC # only windows + VTK_MODULE_ENABLE_VTK_vtkm + VTK_MODULE_ENABLE_VTK_xdmf3 + VTK_MODULE_USE_EXTERNAL_VTK_mpi4py + # Some subprojects + CMAKE_POLICY_DEFAULT_CMP0174 + CMAKE_POLICY_DEFAULT_CMP0177 + # Only with Qt + CMAKE_INSTALL_QMLDIR + VTK_QT_VERSION # Only with Qt + # When working properly these should be unused + VCPKG_LOCK_FIND_PACKAGE_Boost + VCPKG_LOCK_FIND_PACKAGE_CGNS + VCPKG_LOCK_FIND_PACKAGE_LibHaru + VCPKG_LOCK_FIND_PACKAGE_NetCDF + VCPKG_LOCK_FIND_PACKAGE_PROJ + VCPKG_LOCK_FIND_PACKAGE_SEACASExodus + VCPKG_LOCK_FIND_PACKAGE_SEACASIoss + VCPKG_LOCK_FIND_PACKAGE_SQLite3 + VCPKG_LOCK_FIND_PACKAGE_THEORA +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +# ============================================================================= +# Fixup target files +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/vtk-${VTK_SHORT_VERSION}) + +# ============================================================================= +# Clean-up other directories + +# Delete the debug binary TOOL_NAME that is not required +function(_vtk_remove_debug_tool TOOL_NAME) + set(filename "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + if(EXISTS "${filename}") + file(REMOVE "${filename}") + endif() + set(filename "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}d${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + if(EXISTS "${filename}") + file(REMOVE "${filename}") + endif() + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + # we also have to bend the lines referencing the tools in VTKTargets-debug.cmake + # to make them point to the release version of the tools + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-debug.cmake" VTK_TARGETS_CONTENT_DEBUG) + string(REPLACE "debug/bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") + string(REPLACE "tools/vtk/${TOOL_NAME}d" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-debug.cmake" "${VTK_TARGETS_CONTENT_DEBUG}") + endif() +endfunction() + +# Move the release binary TOOL_NAME from bin to tools +function(_vtk_move_release_tool TOOL_NAME) + set(old_filename "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + if(EXISTS "${old_filename}") + file(INSTALL "${old_filename}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk" USE_SOURCE_PERMISSIONS) + file(REMOVE "${old_filename}") + endif() + + if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + # we also have to bend the lines referencing the tools in VTKTargets-release.cmake + # to make them point to the tool folder + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-release.cmake" VTK_TARGETS_CONTENT_RELEASE) + string(REPLACE "bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_RELEASE "${VTK_TARGETS_CONTENT_RELEASE}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-targets-release.cmake" "${VTK_TARGETS_CONTENT_RELEASE}") + endif() +endfunction() + +set(VTK_TOOLS + vtkEncodeString-${VTK_SHORT_VERSION} + vtkHashSource-${VTK_SHORT_VERSION} + vtkWrapTclInit-${VTK_SHORT_VERSION} + vtkWrapTcl-${VTK_SHORT_VERSION} + vtkWrapPythonInit-${VTK_SHORT_VERSION} + vtkWrapPython-${VTK_SHORT_VERSION} + vtkWrapJava-${VTK_SHORT_VERSION} + vtkWrapHierarchy-${VTK_SHORT_VERSION} + vtkParseJava-${VTK_SHORT_VERSION} + vtkParseOGLExt-${VTK_SHORT_VERSION} + vtkProbeOpenGLVersion-${VTK_SHORT_VERSION} + vtkTestOpenGLVersion-${VTK_SHORT_VERSION} + vtkpython + pvtkpython +) +# TODO: Replace with vcpkg_copy_tools if known which tools are built with which feature +# or add and option to vcpkg_copy_tools which does not require the tool to be present +foreach(TOOL_NAME IN LISTS VTK_TOOLS) + _vtk_remove_debug_tool("${TOOL_NAME}") + _vtk_move_release_tool("${TOOL_NAME}") +endforeach() + +if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/vtktoken-9.3.dll" AND VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # vendored "token" library can be only build as a shared library + set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) +elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/bin" + "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/vtk") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/vtkpythonmodules/static_python") #python headers + file(GLOB_RECURSE STATIC_PYTHON_FILES "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/*/static_python/*.h") + file(INSTALL ${STATIC_PYTHON_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") + endif() +endif() + +#remove one get_filename_component(_vtk_module_import_prefix "${_vtk_module_import_prefix}" DIRECTORY) from vtk-prefix.cmake and VTK-vtk-module-properties and vtk-python.cmake +set(filenames_fix_prefix vtk-prefix VTK-vtk-module-properties vtk-python) +foreach(name IN LISTS filenames_fix_prefix) +if(EXISTS "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake") + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake" _contents) + string(REPLACE +[[set(_vtk_module_import_prefix "${CMAKE_CURRENT_LIST_DIR}") +get_filename_component(_vtk_module_import_prefix "${_vtk_module_import_prefix}" DIRECTORY)]] +[[set(_vtk_module_import_prefix "${CMAKE_CURRENT_LIST_DIR}")]] _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake" "${_contents}") +else() + debug_message("FILE:${CURRENT_PACKAGES_DIR}/share/vtk/${name}.cmake does not exist! No prefix correction!") +endif() +endforeach() + +# Use vcpkg provided find method +file(REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindEXPAT.cmake") + +if(EXISTS "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}/vtkChemistryConfigure.h") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}/vtkChemistryConfigure.h" "${SOURCE_PATH}" "not/existing" IGNORE_UNCHANGED) +endif() + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/vtk/VTK-vtk-module-properties.cmake" "_vtk_module_import_prefix}/lib/vtk-9.3/hierarchy" "_vtk_module_import_prefix}$<$<CONFIG:Debug>:/debug>/lib/vtk-9.3/hierarchy") + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +file(RENAME "${CURRENT_PACKAGES_DIR}/share/licenses" "${CURRENT_PACKAGES_DIR}/share/${PORT}/licenses") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright.txt" COMMENT [[ +This file presents the top-level Copyright.txt. +Additional licenses and notes are located in the licenses directory. +]]) diff --git a/vcpkg/ports/vtk/pythonwrapper.patch b/vcpkg/ports/vtk/pythonwrapper.patch new file mode 100644 index 0000000..215c4ac --- /dev/null +++ b/vcpkg/ports/vtk/pythonwrapper.patch @@ -0,0 +1,32 @@ +diff --git a/CMake/vtkModuleWrapPython.cmake b/CMake/vtkModuleWrapPython.cmake
+index 5d2c2e1bf..e33a16d68 100644
+--- a/CMake/vtkModuleWrapPython.cmake
++++ b/CMake/vtkModuleWrapPython.cmake
+@@ -152,23 +152,26 @@ function (_vtk_module_wrap_python_sources module sources classes)
+ set(_vtk_python_genex_compile_definitions "")
+ set(_vtk_python_genex_include_directories "")
+ if (_vtk_python_genex_allowed)
+ set(_vtk_python_genex_compile_definitions
+ "$<TARGET_PROPERTY:${_vtk_python_target_name},COMPILE_DEFINITIONS>")
+ set(_vtk_python_genex_include_directories
+ "$<TARGET_PROPERTY:${_vtk_python_target_name},INCLUDE_DIRECTORIES>")
++ set(_vtk_python_genex_interface_include_directories
++ "$<TARGET_PROPERTY:${_vtk_python_target_name},INTERFACE_INCLUDE_DIRECTORIES>")
+ else ()
+ if (NOT DEFINED ENV{CI})
+ message(AUTHOR_WARNING
+ "Python wrapping is not using target-local compile definitions or "
+ "include directories. This may affect generation of the Python "
+ "wrapper sources for the ${module} module. Use CMake 3.19+ to "
+ "guarantee intended behavior.")
+ endif ()
+ endif ()
+ file(GENERATE
+ OUTPUT "${_vtk_python_args_file}"
+ CONTENT "$<$<BOOL:${_vtk_python_genex_compile_definitions}>:\n-D\'$<JOIN:${_vtk_python_genex_compile_definitions},\'\n-D\'>\'>\n
+ $<$<BOOL:${_vtk_python_genex_include_directories}>:\n-I\'$<JOIN:${_vtk_python_genex_include_directories},\'\n-I\'>\'>\n
++$<$<BOOL:${_vtk_python_genex_interface_include_directories}>:\n-I\'$<JOIN:${_vtk_python_genex_interface_include_directories},\'\n-I\'>\'>\n
+ $<$<BOOL:${_vtk_python_hierarchy_files}>:\n--types \'$<JOIN:${_vtk_python_hierarchy_files},\'\n--types \'>\'>\n")
+
+ set(_vtk_python_sources)
+
diff --git a/vcpkg/ports/vtk/remove-prefix-changes.patch b/vcpkg/ports/vtk/remove-prefix-changes.patch new file mode 100644 index 0000000..3645714 --- /dev/null +++ b/vcpkg/ports/vtk/remove-prefix-changes.patch @@ -0,0 +1,14 @@ +diff --git a/CMake/vtk-config.cmake.in b/CMake/vtk-config.cmake.in +index 9f095ba..8cf7ee2 100644 +--- a/CMake/vtk-config.cmake.in ++++ b/CMake/vtk-config.cmake.in +@@ -114,8 +114,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/vtk-prefix.cmake") + set("${CMAKE_FIND_PACKAGE_NAME}_PREFIX_PATH" + "${_vtk_module_import_prefix}") + unset(_vtk_module_import_prefix) +-list(INSERT CMAKE_PREFIX_PATH 0 +- "${${CMAKE_FIND_PACKAGE_NAME}_PREFIX_PATH}") + + set("${CMAKE_FIND_PACKAGE_NAME}_VERSION" "@VTK_MAJOR_VERSION@.@VTK_MINOR_VERSION@.@VTK_BUILD_VERSION@") + set("${CMAKE_FIND_PACKAGE_NAME}_MAJOR_VERSION" "@VTK_MAJOR_VERSION@") + diff --git a/vcpkg/ports/vtk/usage b/vcpkg/ports/vtk/usage new file mode 100644 index 0000000..3324011 --- /dev/null +++ b/vcpkg/ports/vtk/usage @@ -0,0 +1,4 @@ +The package vtk provides CMake targets:
+
+ find_package(VTK REQUIRED)
+ target_link_libraries(main PRIVATE ${VTK_LIBRARIES})
diff --git a/vcpkg/ports/vtk/use-compile-tools.diff b/vcpkg/ports/vtk/use-compile-tools.diff new file mode 100644 index 0000000..3a7e033 --- /dev/null +++ b/vcpkg/ports/vtk/use-compile-tools.diff @@ -0,0 +1,50 @@ +diff --git a/CMake/vtk-config.cmake.in b/CMake/vtk-config.cmake.in +index 3018421d..a14976ae 100644 +--- a/CMake/vtk-config.cmake.in ++++ b/CMake/vtk-config.cmake.in +@@ -1,3 +1,16 @@ ++ ++set(VTKCompileTools_DIR "@VTKCompileTools_DIR@" CACHE PATH "vcpkg") ++mark_as_advanced(VTKCompileTools_DIR) ++include(CMakeFindDependencyMacro) ++find_dependency(VTKCompileTools CONFIG) ++if(NOT TARGET VTK::WrapHierarchy) ++ add_executable(VTK::WrapHierarchy ALIAS VTKCompileTools::WrapHierarchy) ++ add_executable(VTK::WrapPython ALIAS VTKCompileTools::WrapPython) ++ add_executable(VTK::WrapPythonInit ALIAS VTKCompileTools::WrapPythonInit) ++ add_executable(VTK::ParseJava ALIAS VTKCompileTools::ParseJava) ++ add_executable(VTK::WrapJava ALIAS VTKCompileTools::WrapJava) ++endif() ++ + #[==[.md + # vtk-config.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8df64eb1..67a948e4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -463,6 +463,9 @@ if (NOT DEFINED vtk_cmake_destination) + set(vtk_cmake_destination + "${CMAKE_INSTALL_LIBDIR}/cmake/vtkcompiletools${vtk_version_suffix}") + set(vtk_target_package PACKAGE "${vtk_install_export}") ++ else() ++ # Pull variables for wrapping command invocations into top-level scope ++ find_package(VTKCompileTools REQUIRED) + endif () + endif () + install(TARGETS vtkbuild EXPORT "${vtk_install_export}") +diff --git a/Wrapping/Tools/CMakeLists.txt b/Wrapping/Tools/CMakeLists.txt +index 05aa805f..dbec670a 100644 +--- a/Wrapping/Tools/CMakeLists.txt ++++ b/Wrapping/Tools/CMakeLists.txt +@@ -49,6 +49,10 @@ vtk_module_add_module("${ns}::WrappingTools" + SOURCES ${sources} + HEADERS ${headers}) + ++if (NOT VTK_BUILD_COMPILE_TOOLS_ONLY) ++ return() ++endif() ++ + if (NOT TARGET "${ns}::WrapHierarchy") + vtk_module_add_executable(WrapHierarchy + DEVELOPMENT diff --git a/vcpkg/ports/vtk/vcpkg.json b/vcpkg/ports/vtk/vcpkg.json new file mode 100644 index 0000000..2249f59 --- /dev/null +++ b/vcpkg/ports/vtk/vcpkg.json @@ -0,0 +1,358 @@ +{ + "name": "vtk", + "version-semver": "9.3.0-pv5.12.1", + "port-version": 12, + "description": "Software system for 3D computer graphics, image processing, and visualization", + "homepage": "https://github.com/Kitware/VTK", + "license": null, + "dependencies": [ + "double-conversion", + "eigen3", + "expat", + "exprtk", + "fast-float", + "fmt", + { + "name": "freetype", + "default-features": false, + "features": [ + "zlib" + ] + }, + "gl2ps", + "glew", + { + "name": "hdf5", + "default-features": false, + "features": [ + "zlib" + ] + }, + "jsoncpp", + "libjpeg-turbo", + "liblzma", + "libpng", + { + "name": "libxml2", + "default-features": false, + "features": [ + "zlib" + ] + }, + "lz4", + "nlohmann-json", + "pegtl", + "pugixml", + { + "name": "tiff", + "default-features": false + }, + "utfcpp", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "verdict", + { + "name": "vtk-compile-tools", + "host": true + }, + "zlib" + ], + "default-features": [ + "cgns", + { + "name": "fontconfig", + "platform": "android | linux" + }, + "libharu", + "libtheora", + "netcdf", + "proj", + "seacas", + "sql" + ], + "features": { + "all": { + "description": "Build all vtk modules", + "dependencies": [ + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "avcodec", + "avformat", + "swresample", + "swscale" + ] + }, + "libmysql", + { + "name": "vtk", + "default-features": false, + "features": [ + "cgns", + "fontconfig", + "gdal", + "geojson", + "libharu", + "libtheora", + "mpi", + "netcdf", + "proj", + "python", + "qt", + "seacas", + "sql" + ] + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "atlmfc", + "utf8" + ], + "platform": "windows" + } + ] + }, + "atlmfc": { + "description": "Mfc functionality for vtk on Windows", + "dependencies": [ + { + "name": "atlmfc", + "platform": "windows" + } + ] + }, + "cgns": { + "description": "CGNS functionality for VTK", + "dependencies": [ + { + "name": "cgns", + "default-features": false + } + ] + }, + "cuda": { + "description": "Support CUDA compilation", + "dependencies": [ + "cuda" + ] + }, + "debugleaks": { + "description": "Enables vtk debug leaks detection" + }, + "fontconfig": { + "description": "Enables fontconfig for rendering", + "dependencies": [ + "fontconfig" + ] + }, + "gdal": { + "description": "Support GDAL compilation", + "dependencies": [ + { + "name": "gdal", + "default-features": false + } + ] + }, + "geojson": { + "description": "Convert Geo JSON format to vtkPolyData" + }, + "ioocct": { + "description": "Build with IOOCCT module", + "dependencies": [ + { + "name": "opencascade", + "default-features": false + } + ] + }, + "libharu": { + "description": "PDF functionality for VTK", + "dependencies": [ + { + "name": "libharu", + "version>=": "2.4.3" + } + ] + }, + "libtheora": { + "description": "Compressed ogg functionality for VTK", + "dependencies": [ + "libtheora" + ] + }, + "mpi": { + "description": "MPI functionality for VTK", + "dependencies": [ + { + "name": "hdf5", + "default-features": false, + "features": [ + "parallel" + ] + }, + "mpi", + { + "name": "seacas", + "default-features": false, + "features": [ + "mpi" + ] + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "seacas", + "vtkm" + ] + }, + { + "name": "vtk-m", + "default-features": false, + "features": [ + "mpi" + ] + } + ] + }, + "netcdf": { + "description": "NetCDF functionality for VTK", + "dependencies": [ + { + "name": "netcdf-c", + "default-features": false, + "features": [ + "netcdf-4" + ] + } + ] + }, + "opengl": { + "description": "All opengl related modules" + }, + "openmp": { + "description": "Use openmp multithreading parallel implementation" + }, + "openvr": { + "description": "OpenVR functionality for VTK", + "dependencies": [ + "openvr", + "sdl2" + ] + }, + "paraview": { + "description": "Build vtk modules required by paraview", + "dependencies": [ + "cli11", + "openturns", + { + "name": "vtk", + "default-features": false, + "features": [ + "libtheora", + "netcdf", + "qt", + "seacas" + ] + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "atlmfc" + ], + "platform": "windows" + } + ] + }, + "proj": { + "description": "Geographic projection functionality for VTK", + "dependencies": [ + { + "name": "proj", + "default-features": false + } + ] + }, + "python": { + "description": "Python functionality for VTK", + "dependencies": [ + "python3" + ] + }, + "qt": { + "description": "Qt functionality for VTK", + "dependencies": [ + { + "name": "qtbase", + "default-features": false, + "features": [ + "gui", + "opengl", + "sql-sqlite", + "widgets" + ] + }, + "qtdeclarative", + { + "name": "vtk", + "default-features": false, + "features": [ + "sql" + ] + } + ] + }, + "seacas": { + "description": "Exodus and IOSS functionality for VTK", + "dependencies": [ + { + "name": "seacas", + "default-features": false + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "cgns", + "netcdf" + ] + } + ] + }, + "sql": { + "description": "SQL functionality for VTK", + "dependencies": [ + "sqlite3" + ] + }, + "tbb": { + "description": "Use TBB multithreading parallel implementation", + "dependencies": [ + "tbb" + ] + }, + "utf8": { + "description": "Enables vtk reader/writer with utf-8 path support" + }, + "vtkm": { + "description": "Build with vtk-m accelerator and module.", + "dependencies": [ + { + "name": "vtk-m", + "default-features": false + } + ] + } + } +} diff --git a/vcpkg/ports/vtk/vtkioss.patch b/vcpkg/ports/vtk/vtkioss.patch new file mode 100644 index 0000000..57bf0a7 --- /dev/null +++ b/vcpkg/ports/vtk/vtkioss.patch @@ -0,0 +1,25 @@ +diff --git a/ThirdParty/ioss/CMakeLists.txt b/ThirdParty/ioss/CMakeLists.txt
+index 3066c4bb5..44e1eb1bf 100644
+--- a/ThirdParty/ioss/CMakeLists.txt
++++ b/ThirdParty/ioss/CMakeLists.txt
+@@ -5,7 +5,7 @@ vtk_module_third_party(
+ STANDARD_INCLUDE_DIRS
+ EXTERNAL
+ PACKAGE SEACASIoss
+- TARGETS Ioss
++ TARGETS Ioss Ionit
+ USE_VARIABLES SEACASIoss_INCLUDE_DIRS
+ STANDARD_INCLUDE_DIRS)
+
+diff --git a/IO/IOSS/vtkIOSSReader.cxx b/IO/IOSS/vtkIOSSReader.cxx
+index 04de56cb20..b905e84a3e 100644
+--- a/IO/IOSS/vtkIOSSReader.cxx
++++ b/IO/IOSS/vtkIOSSReader.cxx
+@@ -61,6 +61,7 @@
+ #include VTK_IOSS(Ioss_SideBlock.h)
+ #include VTK_IOSS(Ioss_SideSet.h)
+ #include VTK_IOSS(Ioss_StructuredBlock.h)
++#include VTK_IOSS(Iotr_Factory.h)
+ // clang-format on
+
+ #include <array>
diff --git a/vcpkg/ports/vtk/vtkm.patch b/vcpkg/ports/vtk/vtkm.patch new file mode 100644 index 0000000..c593c97 --- /dev/null +++ b/vcpkg/ports/vtk/vtkm.patch @@ -0,0 +1,157 @@ +diff --git a/Accelerators/Vtkm/Core/CMakeLists.txt b/Accelerators/Vtkm/Core/CMakeLists.txt +index 397dca9f6..bc9c62ac5 100644 +--- a/Accelerators/Vtkm/Core/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/CMakeLists.txt +@@ -1,4 +1,3 @@ +-list(INSERT CMAKE_MODULE_PATH 0 +- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake") ++find_package(VTKm CONFIG REQUIRED) + + set(private_headers +@@ -31,8 +31,5 @@ vtkm_add_target_information(${vtkm_accel_target} + NOWRAP_HEADERS ${nowrap_headers} + NOWRAP_CLASSES ${nowrap_classes} + PRIVATE_HEADERS ${private_headers}) +-vtk_module_set_property(VTK::AcceleratorsVTKmCore +- PROPERTY JOB_POOL_COMPILE +- VALUE vtkm_pool) + + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmCore) +diff --git a/Accelerators/Vtkm/DataModel/CMakeLists.txt b/Accelerators/Vtkm/DataModel/CMakeLists.txt +index 9d5dfe100..7fea257b7 100644 +--- a/Accelerators/Vtkm/DataModel/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/CMakeLists.txt +@@ -1,7 +1,6 @@ + set(VTKm_NO_DEPRECATED_VIRTUAL ON) + +-list(INSERT CMAKE_MODULE_PATH 0 +- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake") ++find_package(VTKm CONFIG REQUIRED) + + set(sources + vtkmlib/ArrayConvertersReal.cxx +@@ -40,6 +39,3 @@ vtkm_add_target_information(${vtkm_accel_target} + NOWRAP_CLASSES ${nowrap_classes} + PRIVATE_HEADERS ${private_headers}) +-vtk_module_set_property(VTK::AcceleratorsVTKmDataModel +- PROPERTY JOB_POOL_COMPILE +- VALUE vtkm_pool) + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmDataModel) +diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt +index 0f51c436d..567b49197 100644 +--- a/Accelerators/Vtkm/Filters/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/CMakeLists.txt +@@ -1,7 +1,6 @@ + set(VTKm_NO_DEPRECATED_VIRTUAL ON) + +-list(INSERT CMAKE_MODULE_PATH 0 +- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake") ++find_package(VTKm CONFIG REQUIRED) + + set(classes + vtkmAverageToCells +@@ -91,7 +90,4 @@ vtkm_add_target_information(${vtkm_accel_target} + HEADERS ${headers} + CLASSES ${classes}) +-vtk_module_set_property(VTK::AcceleratorsVTKmFilters +- PROPERTY JOB_POOL_COMPILE +- VALUE vtkm_pool) + vtk_module_link(VTK::AcceleratorsVTKmFilters + PRIVATE +diff --git a/CMake/vtk-config.cmake.in b/CMake/vtk-config.cmake.in +index a8c40085a..764298f0e 100644 +--- a/CMake/vtk-config.cmake.in ++++ b/CMake/vtk-config.cmake.in +@@ -126,9 +126,7 @@ set("${CMAKE_FIND_PACKAGE_NAME}_AVAILABLE_COMPONENTS" "@vtk_all_components@") + unset("${CMAKE_FIND_PACKAGE_NAME}_FOUND") + set("${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm" "@vtk_has_vtkm@") + if (${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm) +- find_package(VTKm +- PATHS "${CMAKE_CURRENT_LIST_DIR}/vtkm" +- NO_DEFAULT_PATH) ++ find_package(VTKm CONFIG REQUIRED) + if (NOT VTKm_FOUND) + set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0) + endif () +diff --git a/ThirdParty/vtkm/CMakeLists.txt b/ThirdParty/vtkm/CMakeLists.txt +index 8cfbf92b0..ad78cc8f5 100644 +--- a/ThirdParty/vtkm/CMakeLists.txt ++++ b/ThirdParty/vtkm/CMakeLists.txt +@@ -1,15 +1,34 @@ +-vtk_module_third_party_internal( +- LICENSE_FILES +- "vtkvtkm/vtk-m/LICENSE.txt" +- SPDX_LICENSE_IDENTIFIER +- "BSD-3-Clause" +- SPDX_COPYRIGHT_TEXT +- "Copyright (c) 2014-2023 Kitware Inc., National Technology & Engineering Solutions of Sandia, LLC (NTESS)," +- "UT-Battelle, LLC., Los Alamos National Security, LLC." +- SPDX_DOWNLOAD_LOCATION +- "git+https://gitlab.kitware.com/vtk/vtk-m.git@2.0.0@v2.0.0" +- VERSION +- "2.0.0" +- SUBDIRECTORY vtkvtkm +- STANDARD_INCLUDE_DIRS +- INTERFACE) ++message(STATUS "VTK_MODULE_USE_EXTERNAL_VTK_vtkm: ${VTK_MODULE_USE_EXTERNAL_VTK_vtkm}") ++if(TRUE) ++ message(STATUS "Searching for external VTKm") ++ find_package(VTKm CONFIG REQUIRED) ++ if(TARGET vtkm::compiler_flags) ++ get_target_property(VTKm_INCLUDE_DIRS vtkm::compiler_flags INTERFACE_INCLUDE_DIRECTORIES) ++ message(STATUS "INCLUDE: ${VTKm_INCLUDE_DIRS}") ++ get_target_property(VTKm_DIY_INCLUDE_DIRS vtkm::vtkmdiy INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(VTKm_OPTION_INCLUDE_DIRS vtkm::optionparser INTERFACE_INCLUDE_DIRECTORIES) ++ if(MSVC) ++ set(VTKm_DEFINITIONS /bigobj) ++ endif() ++ else() ++ message(FATAL_ERROR "VTKM target missing") ++ endif() ++ if(VTKM_FOUND) ++ message(STATUS "Found VTKm") ++ endif() ++endif() ++ ++vtk_module_third_party( ++ INTERNAL ++ HEADER_ONLY ++ LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt" ++ VERSION "master" ++ SUBDIRECTORY vtkvtkm ++ STANDARD_INCLUDE_DIRS ++ INTERFACE ++ EXTERNAL ++ PACKAGE VTKm ++ TARGETS vtkm::cont vtkm::filter vtkm::vtkmdiy vtkm::optionparser ++ #LIBRARIES vtkm_cont vtkm_filter vtkm_diy vtkm_optionparser vtkm_taotuple ++ INCLUDE_DIRS VTKm_INCLUDE_DIRS VTKm_DIY_INCLUDE_DIRS VTKm_OPTION_INCLUDE_DIRS ++) +diff --git a/ThirdParty/vtkm/vtk.module b/ThirdParty/vtkm/vtk.module +index a8e4dad0f..c7bbbf0e8 100644 +--- a/ThirdParty/vtkm/vtk.module ++++ b/ThirdParty/vtkm/vtk.module +@@ -3,5 +3,7 @@ NAME + PRIVATE_DEPENDS + # While not needed to satisfy symbols, this is necessary to guarantee that + # VTK_SMP_IMPLEMENTATION_TYPE is available when configuring vtk-m. +- VTK::CommonCore ++ # VTK::CommonCore ++LIBRARY_NAME ++ VTKm + THIRD_PARTY +diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt +index 7c1b10410c..610bf831fb 100644 +--- a/Accelerators/Vtkm/Filters/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/CMakeLists.txt +@@ -91,8 +91,8 @@ vtk_module_add_module(VTK::AcceleratorsVTKmFilters + CLASSES ${classes}) + vtk_module_link(VTK::AcceleratorsVTKmFilters + PRIVATE +- vtkm_worklet +- vtkm_filter) ++ vtkm::worklet ++ vtkm::filter) + vtk_module_definitions(VTK::AcceleratorsVTKmFilters + PUBLIC "VTK_ENABLE_VTKM_OVERRIDES=$<BOOL:${VTK_ENABLE_VTKM_OVERRIDES}>") + diff --git a/vcpkg/ports/vtk/zspace.diff b/vcpkg/ports/vtk/zspace.diff new file mode 100644 index 0000000..0b73cbe --- /dev/null +++ b/vcpkg/ports/vtk/zspace.diff @@ -0,0 +1,13 @@ +diff --git a/Rendering/ZSpace/vtk.module b/Rendering/ZSpace/vtk.module +index cf6b6a2d6365b763f80e2e166928ebc2176febdf..1e6869ee05da1de1eea38207d8cfab7cce10d646 100644 +--- a/Rendering/ZSpace/vtk.module ++++ b/Rendering/ZSpace/vtk.module +@@ -8,6 +8,8 @@ SPDX_LICENSE_IDENTIFIER + BSD-3-Clause + SPDX_COPYRIGHT_TEXT + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen ++CONDITION ++ WIN32 + DEPENDS + VTK::CommonCore + VTK::CommonDataModel |