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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/vtk/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Description: Python functionality for VTK
Build-Depends: python3

Feature: atlmfc
Description: Mfc functionality for vtk on Windows
Description: Mfc functionality for VTK on Windows
Build-Depends: atlmfc (windows)

Feature: paraview
Expand Down
127 changes: 62 additions & 65 deletions ports/vtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ if("qt" IN_LIST FEATURES)
-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_AcceleratorsVTKm=YES
Expand All @@ -36,13 +31,40 @@ if("python" IN_LIST FEATURES)
-DVTK_WRAP_PYTHON=ON
-DVTK_PYTHON_VERSION=3
-DPython3_FIND_REGISTRY=NEVER
-DCMAKE_DISABLE_FIND_PACKAGE_Python3=TRUE
"-DPython3_EXECUTABLE:PATH=${PYTHON3}"
)

if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python37.lib"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python37_d.lib"
"-DPython3_LIBRARIES:STRING=debug\\\\\\\;${CURRENT_INSTALLED_DIR}/debug/lib/python37_d.lib\\\\\\\;optimized\\\\\\\;${CURRENT_INSTALLED_DIR}/lib/python37.lib"
"-DPYTHON_DEBUG_LIBRARY:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python37_d.lib"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.7")
elseif(VCPKG_TARGET_IS_LINUX)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython37m.a"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython37md.a"
"-DPython3_LIBRARIES:STRING=debug\\\\\\\;${CURRENT_INSTALLED_DIR}/debug/lib/libpython37md.a\\\\\\\;optimized\\\\\\\;${CURRENT_INSTALLED_DIR}/lib/libpython37m.a"
"-DPYTHON_DEBUG_LIBRARY:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython37md.a"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.7m")
elseif(VCPKG_TARGET_IS_OSX)
#Need Python3 information on OSX within VCPKG
endif()

#VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages
endif()

if("paraview" IN_LIST FEATURES)
if(VTK_WITH_QT_OPENGL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this value is not set, I think it is always 0.

list(APPEND ADDITIONAL_OPTIONS
-DVTK_Group_Qt=ON
-DvtkGUISupportQtOpenGL=ON
-DModule_vtkGUISupportQtOpenGL=ON
-DVTK_QT_VERSION=5
-DVTK_BUILD_QT_DESIGNER_PLUGIN=OFF
)
endif()

list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_FiltersParallelStatistics=YES
-DVTK_MODULE_ENABLE_VTK_IOParallelExodus=YES
Expand All @@ -56,7 +78,6 @@ if("paraview" IN_LIST FEATURES)
-DVTK_MODULE_ENABLE_VTK_IOVPIC=YES
-DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_RenderingAnnotation=YES
-DVTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2=YES
)
if("python" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
Expand All @@ -71,19 +92,6 @@ if("mpi" IN_LIST FEATURES)
)
endif()

if("opengl" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_MODULE_ENABLE_VTK_DomainsChemestryOpenGL2=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("all" IN_LIST FEATURES)
list(APPEND ADDITIONAL_OPTIONS
-DVTK_USE_TK=OFF # TCL/TK currently not included in vcpkg
Expand All @@ -101,26 +109,25 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Kitware/VTK
REF 96e6fa9b3ff245e4d51d49f23d40e9ad8774e85e # v9.0.1
SHA512 0efb1845053b6143e5ee7fa081b8be98f6825262c59051e88b2be02497e23362055067b2f811eff82e93eb194e5a9afd2a12e3878a252eb4011a5dab95127a6f
REF ab278e87b181e3a02082bea7361fbaa3ddafb3ad # v9.0
SHA512 50a324f55b58bc4415f972f711420e83b41a100b27729266db4541c24bc7d7bcd27d9158ce2588178b9b2e43c20b9695ffe382605f5cde331e8371e213655164
HEAD_REF master
PATCHES
FindLZMA.patch # Will be fixed in 9.1?
FindLibHaru.patch
FindLZMA.patch
FindLZ4.patch
Findproj.patch
vtkm.patch # To include an external VTKm build (v.1.5 required)
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
##pythonwrapper.patch # needs checking with paraview PR if still required
##NoUndefDebug.patch # needs checking with paraview PR if still required
# Last patch TODO: Patch out internal loguru
)

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

# =============================================================================
Expand All @@ -140,7 +147,6 @@ vcpkg_configure_cmake(
-DVTK_INSTALL_PACKAGE_DIR=share/vtk
-DVTK_INSTALL_RUNTIME_DIR=bin
-DVTK_FORBID_DOWNLOADS=ON
-DVTK_ENABLE_REMOTE_MODULES=OFF
# VTK groups to enable
-DVTK_GROUP_ENABLE_StandAlone=YES
-DVTK_GROUP_ENABLE_Rendering=YES
Expand All @@ -150,6 +156,9 @@ vcpkg_configure_cmake(
# Select modules / groups to install
-DVTK_USE_EXTERNAL:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps:BOOL=OFF # Not yet in VCPKG
-DModule_vtkGUISupportQt=ON
-DModule_vtkGUISupportQtOpenGL=ON

${ADDITIONAL_OPTIONS}
)

Expand Down Expand Up @@ -199,14 +208,12 @@ function(_vtk_remove_debug_tool TOOL_NAME)
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()
# 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}")
endfunction()

# Move the release binary TOOL_NAME from bin to tools
Expand All @@ -217,13 +224,11 @@ function(_vtk_move_release_tool TOOL_NAME)
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()
# 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}")
endfunction()

set(VTK_SHORT_VERSION 9.0)
Expand Down Expand Up @@ -260,37 +265,29 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# =============================================================================
# Handle copyright
file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(COPY ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/vtk)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/vtk/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/vtk/copyright)

vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/vtk")

## Files Modules needed by ParaView
if("paraview" IN_LIST FEATURES)
set(VTK_CMAKE_NEEDED vtkCompilerChecks vtkCompilerPlatformFlags vtkCompilerExtraFlags vtkInitializeBuildType
vtkSupportMacros vtkDirectories vtkVersion FindPythonModules vtkModuleDebugging vtkExternalData)
set(VTK_CMAKE_NEEDED vtkCompilerChecks vtkCompilerPlatformFlags vtkCompilerExtraFlags vtkInitializeBuildType vtkSupportMacros vtkDirectories vtkVersion FindPythonModules)
foreach(module ${VTK_CMAKE_NEEDED})
file(INSTALL "${SOURCE_PATH}/CMake/${module}.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk")
file(INSTALL "${SOURCE_PATH}/CMake/${module}.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/share/vtk)
endforeach()

## Check List on UPDATE !!
file(INSTALL "${SOURCE_PATH}/CMake/vtkRequireLargeFilesSupport.cxx" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk")

file(INSTALL "${SOURCE_PATH}/GUISupport/Qt/QVTKOpenGLWidget.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # Legacy header
file(INSTALL "${SOURCE_PATH}/CMake/vtkRequireLargeFilesSupport.cxx" DESTINATION ${CURRENT_PACKAGES_DIR}/share/vtk)

file(INSTALL "${SOURCE_PATH}/Common/Core/vtkRange.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK
file(INSTALL "${SOURCE_PATH}/Common/Core/vtkRangeIterableTraits.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK
file(INSTALL "${SOURCE_PATH}/Common/DataModel/vtkCompositeDataSetNodeReference.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}") # this should get installed by VTK
#ParaView requires some internal headers
file(INSTALL "${SOURCE_PATH}/Rendering/Annotation/vtkScalarBarActorInternal.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}")
file(INSTALL "${SOURCE_PATH}/Filters/Statistics/vtkStatisticsAlgorithmPrivate.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}")
file(INSTALL "${SOURCE_PATH}/Rendering/OpenGL2/vtkCompositePolyDataMapper2Internal.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}")
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Rendering/OpenGL2/vtkTextureObjectVS.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}")
#ParaView requires some internal headers
file(INSTALL ${SOURCE_PATH}/Rendering/Annotation/vtkScalarBarActorInternal.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION})
file(INSTALL ${SOURCE_PATH}/Filters/Statistics/vtkStatisticsAlgorithmPrivate.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION})
file(INSTALL ${SOURCE_PATH}/Rendering/OpenGL2/vtkCompositePolyDataMapper2Internal.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION})
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Rendering/OpenGL2/vtkTextureObjectVS.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION})
endif()

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})
if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/static_python) #python headers
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/static_python DESTINATION ${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION})
endif()
endif()

Expand Down