diff options
| -rw-r--r-- | ports/vtk/CONTROL | 2 | ||||
| -rw-r--r-- | ports/vtk/portfile.cmake | 53 |
2 files changed, 45 insertions, 10 deletions
diff --git a/ports/vtk/CONTROL b/ports/vtk/CONTROL index 0eb485dcd..2521ed58c 100644 --- a/ports/vtk/CONTROL +++ b/ports/vtk/CONTROL @@ -1,5 +1,5 @@ Source: vtk -Version: 8.1.0-6 +Version: 8.1.0-7 Description: Software system for 3D computer graphics, image processing, and visualization Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, libjpeg-turbo, proj4, lz4, libtheora diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 7a5536163..8b6123eb7 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -166,7 +166,7 @@ vcpkg_configure_cmake( -DVTK_INSTALL_DATA_DIR=share/vtk/data -DVTK_INSTALL_DOC_DIR=share/vtk/doc -DVTK_INSTALL_PACKAGE_DIR=share/vtk - -DVTK_INSTALL_RUNTIME_DIR=tools + -DVTK_INSTALL_RUNTIME_DIR=bin -DVTK_FORBID_DOWNLOADS=ON ${ADDITIONAL_OPTIONS} ) @@ -306,12 +306,44 @@ endforeach() # ============================================================================= # Clean-up other directories +# Delete the debug binary TOOL_NAME that is not required +function(_vtk_remove_debug_tool TOOL_NAME) + # on windows, the tools end with .exe + set(filename_win ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}.exe) + if(EXISTS ${filename_win}) + file(REMOVE ${filename_win}) + endif() + # on other OS, it doesn't + set(filename_unix ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}) + if(EXISTS ${filename_unix}) + file(REMOVE ${filename_unix}) + 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/VTKTargets-debug.cmake" VTK_TARGETS_CONTENT_DEBUG) + string(REPLACE "debug/bin/${TOOL_NAME}" "tools/vtk/${TOOL_NAME}" VTK_TARGETS_CONTENT_DEBUG "${VTK_TARGETS_CONTENT_DEBUG}") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets-debug.cmake" "${VTK_TARGETS_CONTENT_DEBUG}") +endfunction() -function(_vtk_remove_tool TOOL_NAME) - set(filename ${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}.exe) - if(EXISTS ${filename}) - file(REMOVE ${filename}) +# Move the release binary TOOL_NAME from bin to tools +function(_vtk_move_release_tool TOOL_NAME) + # on windows, the tools end with .exe + set(old_filename_win "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}.exe") + if(EXISTS ${old_filename_win}) + file(INSTALL ${old_filename_win} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk") + file(REMOVE ${old_filename_win}) endif() + # on other OS, it doesn't + set(old_filename_unix "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}") + if(EXISTS ${old_filename_unix}) + file(INSTALL ${old_filename_unix} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk") + file(REMOVE ${old_filename_unix}) + 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/VTKTargets-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/VTKTargets-release.cmake" "${VTK_TARGETS_CONTENT_RELEASE}") endfunction() set(VTK_TOOLS @@ -329,15 +361,16 @@ set(VTK_TOOLS pvtkpython ) +foreach(TOOL_NAME IN LISTS VTK_TOOLS) + _vtk_remove_debug_tool("${TOOL_NAME}") + _vtk_move_release_tool("${TOOL_NAME}") +endforeach() + file(READ "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/vtkhdf5.cmake" _contents) string(REPLACE "vtk::hdf5::hdf5_hl" "" _contents "${_contents}") string(REPLACE "vtk::hdf5::hdf5" "" _contents "${_contents}") file(WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/vtkhdf5.cmake" "${_contents}") -foreach(TOOL_NAME IN LISTS VTK_TOOLS) - _vtk_remove_tool("${TOOL_NAME}") -endforeach() - # ============================================================================= # Remove other files and directories that are not valid for vcpkg if(VTK_WITH_ALL_MODULES) @@ -357,3 +390,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle 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) |
