aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorat-2500 <at-2500@users.noreply.github.com>2019-02-21 20:47:54 +0100
committerVictor Romero <romerosanchezv@gmail.com>2019-02-21 11:47:54 -0800
commita8e52b1e0597ccbc8f1da1e969501cacb8280daa (patch)
tree5c2d2bdec3d5af317f8f86b8f02c8dcf3201b4ec
parentf2eea8f13a846184f56465945d204545597b3c2e (diff)
downloadvcpkg-a8e52b1e0597ccbc8f1da1e969501cacb8280daa.tar.gz
vcpkg-a8e52b1e0597ccbc8f1da1e969501cacb8280daa.zip
[vtk] Change the runtime dir from tools to bin to fix DLL location (#5150)
* [vtk] Change the runtime dir from tools to bin to fix DLL location * Also move the tools on unixoid OS; Fix tool names in targets files * Remove duplicate vcpkg_copy_pdbs() * [vtk] Change version to force rebuild in CI
-rw-r--r--ports/vtk/CONTROL2
-rw-r--r--ports/vtk/portfile.cmake53
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)