2018-12-18 04:09:44 +08:00
if ( VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
message ( WARNING "You will need to install Xorg dependencies to build vtk:\napt-get install libxt-dev\n" )
endif ( )
2017-01-12 18:03:02 +08:00
include ( vcpkg_common_functions )
2018-01-09 15:22:21 +08:00
set ( VTK_SHORT_VERSION "8.1" )
set ( VTK_LONG_VERSION "${VTK_SHORT_VERSION}.0" )
2017-08-28 16:48:30 +08:00
# =============================================================================
2018-01-05 00:57:30 +08:00
# Options:
2017-11-02 04:20:00 +08:00
if ( "qt" IN_LIST FEATURES )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_QT ON )
2017-11-02 04:20:00 +08:00
else ( )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_QT OFF )
2017-11-02 04:20:00 +08:00
endif ( )
if ( "mpi" IN_LIST FEATURES )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_MPI ON )
2017-11-02 04:20:00 +08:00
else ( )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_MPI OFF )
2017-11-02 04:20:00 +08:00
endif ( )
if ( "python" IN_LIST FEATURES )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_PYTHON ON )
2017-11-02 04:20:00 +08:00
else ( )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_PYTHON OFF )
2017-11-02 04:20:00 +08:00
endif ( )
2017-11-09 07:33:29 +08:00
2017-11-02 04:20:00 +08:00
if ( "openvr" IN_LIST FEATURES )
2018-01-05 00:57:30 +08:00
set ( VTK_WITH_OPENVR ON )
2017-11-02 04:20:00 +08:00
else ( )
set ( VTK_WITH_OPENVR OFF )
endif ( )
2017-11-07 02:35:12 +08:00
if ( "libharu" IN_LIST FEATURES )
set ( VTK_WITH_LIBHARU ON )
else ( )
set ( VTK_WITH_LIBHARU OFF )
endif ( )
2017-08-28 16:48:30 +08:00
set ( VTK_WITH_ALL_MODULES OFF ) # IMPORTANT: if ON make sure `qt5`, `mpi`, `python3`, `ffmpeg`, `gdal`, `fontconfig`,
# `libmysql` and `atlmfc` are listed as dependency in the CONTROL file
2018-10-26 02:47:58 +08:00
2017-08-28 16:48:30 +08:00
# =============================================================================
2018-10-26 02:47:58 +08:00
# Clone & patch
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O " K i t w a r e / V T K "
R E F " v $ { V T K _ L O N G _ V E R S I O N } "
S H A 5 1 2 0 9 e 1 1 0 c b a 4 a d 9 a 6 6 8 4 e 9 b 2 a f 0 c b b 5 b 9 0 5 3 e 3 5 9 6 c c b 6 2 a a b 9 6 c d 9 e 7 1 a a 4 a 9 6 c 8 0 9 d 9 6 e 1 3 1 5 3 f f 4 4 c 2 8 a d 8 3 0 1 5 a 6 1 b a 5 1 9 5 f 7 d 3 4 0 5 6 7 0 7 b 6 2 6 5 4 c 1 b c 0 5 7 f 9 b 9 e d f
H E A D _ R E F " m a s t e r "
2017-08-08 23:56:09 +08:00
P A T C H E S
2017-08-10 17:56:23 +08:00
# Disable ssize_t because this can conflict with ssize_t that is defined on windows.
2018-10-26 02:47:58 +08:00
d o n t - d e f i n e - s s i z e _ t . p a t c h
2017-08-10 17:56:23 +08:00
# We force CMake to use it's own version of the FindHDF5 module since newer versions
# shipped with CMake behave differently. E.g. the one shipped with CMake 3.9 always
# only finds the release libraries, but not the debug libraries.
# The file shipped with CMake allows us to set the libraries explicitly as it is done below.
# Maybe in the future we can disable the patch and use the new version shipped with CMake
# together with the hdf5-config.cmake that is written by HDF5 itself, but currently VTK
# disables taking the config into account explicitly.
2018-10-26 02:47:58 +08:00
u s e - f i x e d - f i n d - h d f 5 . p a t c h
2017-08-10 17:56:23 +08:00
# We disable a workaround in the VTK CMake scripts that can lead to the fact that a dependency
# will link to both, the debug and the release library.
2018-10-26 02:47:58 +08:00
d i s a b l e - w o r k a r o u n d - f i n d h d f 5 . p a t c h
2017-08-11 03:58:44 +08:00
2018-10-26 02:47:58 +08:00
f i x - f i n d - l i b p r o j 4 . p a t c h
f i x - f i n d - l i b h a r u . p a t c h
f i x - f i n d - m y s q l . p a t c h
f i x - f i n d - o d b c . p a t c h
2018-11-09 02:46:25 +08:00
f i x - f i n d - l z 4 . p a t c h
2017-08-08 23:56:09 +08:00
)
2017-08-28 16:48:30 +08:00
# Remove the FindGLEW.cmake and FindPythonLibs.cmake that are distributed with VTK,
# since they do not detect the debug libraries correctly.
# The default files distributed with CMake (>= 3.9) should be superior by all means.
# For GDAL, the one distributed with CMake does not detect the debug libraries correctly,
# so we provide an own one.
2017-08-11 00:20:40 +08:00
file ( REMOVE ${ SOURCE_PATH } /CMake/FindGLEW.cmake )
2017-08-28 16:48:30 +08:00
file ( REMOVE ${ SOURCE_PATH } /CMake/FindPythonLibs.cmake )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /FindGDAL.cmake DESTINATION ${ SOURCE_PATH } /CMake )
2017-11-09 07:33:29 +08:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /FindHDF5.cmake DESTINATION ${ SOURCE_PATH } /CMake/NewCMake )
2017-08-28 16:48:30 +08:00
# =============================================================================
# Collect CMake options for optional components
if ( VTK_WITH_QT )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ G r o u p _ Q t = O N
- D V T K _ Q T _ V E R S I O N = 5
- D V T K _ B U I L D _ Q T _ D E S I G N E R _ P L U G I N = O F F
)
endif ( )
if ( VTK_WITH_MPI )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ G r o u p _ M P I = O N
)
endif ( )
if ( VTK_WITH_PYTHON )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ W R A P _ P Y T H O N = O N
- D V T K _ P Y T H O N _ V E R S I O N = 3
)
endif ( )
2017-11-02 04:20:00 +08:00
if ( VTK_WITH_OPENVR )
list ( APPEND ADDITIONAL_OPTIONS
- D M o d u l e _ v t k R e n d e r i n g O p e n V R = O N
)
endif ( )
2017-11-07 02:35:12 +08:00
if ( VTK_WITH_LIBHARU )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ U S E _ S Y S T E M _ L I B H A R U = O N
)
endif ( )
2017-08-28 16:48:30 +08:00
if ( VTK_WITH_ALL_MODULES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ B U I L D _ A L L _ M O D U L E S = O N
- D V T K _ U S E _ T K = O F F # TCL/TK currently not included in vcpkg
# -DVTK_USE_SYSTEM_AUTOBAHN=ON
# -DVTK_USE_SYSTEM_SIX=ON
# -DVTK_USE_SYSTEM_MPI4PY=ON
# -DVTK_USE_SYSTEM_CONSTANTLY=ON
# -DVTK_USE_SYSTEM_INCREMENTAL=ON
# -DVTK_USE_SYSTEM_TWISTED=ON
# -DVTK_USE_SYSTEM_XDMF2=ON
# -DVTK_USE_SYSTEM_XDMF3=ON
# -DVTK_USE_SYSTEM_ZFP=ON
# -DVTK_USE_SYSTEM_ZOPE=ON
)
endif ( )
2017-08-11 00:20:40 +08:00
2017-08-28 16:48:30 +08:00
# =============================================================================
# Configure & Install
2017-01-12 18:03:02 +08:00
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2017-02-28 21:45:42 +08:00
P R E F E R _ N I N J A
2017-01-12 18:03:02 +08:00
O P T I O N S
2017-08-28 16:48:30 +08:00
- D V T K _ G r o u p _ I m a g i n g = O N
- D V T K _ G r o u p _ V i e w s = O N
2017-01-12 18:03:02 +08:00
- D B U I L D _ T E S T I N G = O F F
2017-02-28 21:45:42 +08:00
- D B U I L D _ E X A M P L E S = O F F
2017-01-12 18:03:02 +08:00
- D V T K _ U S E _ S Y S T E M _ E X P A T = O N
- D V T K _ U S E _ S Y S T E M _ F R E E T Y P E = O N
# -DVTK_USE_SYSTEM_GL2PS=ON
2017-08-11 03:58:44 +08:00
- D V T K _ U S E _ S Y S T E M _ J P E G = O N
2017-01-12 18:03:02 +08:00
- D V T K _ U S E _ S Y S T E M _ G L E W = O N
- D V T K _ U S E _ S Y S T E M _ H D F 5 = O N
- D V T K _ U S E _ S Y S T E M _ J S O N C P P = O N
2017-08-11 03:58:44 +08:00
- D V T K _ U S E _ S Y S T E M _ L I B P R O J 4 = O N
2017-01-12 18:03:02 +08:00
- D V T K _ U S E _ S Y S T E M _ L I B X M L 2 = O N
2017-08-11 03:58:44 +08:00
- D V T K _ U S E _ S Y S T E M _ L Z 4 = O N
2017-01-12 18:03:02 +08:00
# -DVTK_USE_SYSTEM_NETCDF=ON
2017-08-11 03:58:44 +08:00
# -DVTK_USE_SYSTEM_NETCDFCPP=ON
2017-08-11 16:17:32 +08:00
- D V T K _ U S E _ S Y S T E M _ O G G T H E O R A = O N
2017-01-12 18:03:02 +08:00
- D V T K _ U S E _ S Y S T E M _ P N G = O N
- D V T K _ U S E _ S Y S T E M _ T I F F = O N
- D V T K _ U S E _ S Y S T E M _ Z L I B = O N
2017-08-11 16:17:32 +08:00
- D V T K _ I N S T A L L _ I N C L U D E _ D I R = i n c l u d e
2017-01-12 18:03:02 +08:00
- D V T K _ I N S T A L L _ D A T A _ D I R = s h a r e / v t k / d a t a
- D V T K _ I N S T A L L _ D O C _ D I R = s h a r e / v t k / d o c
- D V T K _ I N S T A L L _ P A C K A G E _ D I R = s h a r e / v t k
2019-02-22 03:47:54 +08:00
- D V T K _ I N S T A L L _ R U N T I M E _ D I R = b i n
2017-02-28 21:45:42 +08:00
- D V T K _ F O R B I D _ D O W N L O A D S = O N
2017-01-12 18:03:02 +08:00
$ { A D D I T I O N A L _ O P T I O N S }
)
vcpkg_install_cmake ( )
vcpkg_copy_pdbs ( )
2017-08-28 16:48:30 +08:00
# =============================================================================
# Fixup target files
2017-08-10 17:56:23 +08:00
vcpkg_fixup_cmake_targets ( )
2017-01-12 18:03:02 +08:00
2017-08-28 16:48:30 +08:00
# For some reason the references to the XDMF libraries in the target files do not end up
# correctly, so we fix them here.
if ( VTK_WITH_ALL_MODULES )
file ( READ ${ CURRENT_PACKAGES_DIR } /share/vtk/VTKTargets-release.cmake VTK_TARGETS_RELEASE_CONTENT )
string ( REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}" )
string ( REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}" )
string ( REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}" )
string ( REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_RELEASE_CONTENT "${VTK_TARGETS_RELEASE_CONTENT}" )
file ( WRITE ${ CURRENT_PACKAGES_DIR } /share/vtk/VTKTargets-release.cmake "${VTK_TARGETS_RELEASE_CONTENT}" )
file ( READ ${ CURRENT_PACKAGES_DIR } /share/vtk/VTKTargets-debug.cmake VTK_TARGETS_DEBUG_CONTENT )
string ( REPLACE "lib/../XdmfCore.lib" "lib/XdmfCore.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}" )
string ( REPLACE "bin/../XdmfCore.dll" "bin/XdmfCore.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}" )
string ( REPLACE "lib/../vtkxdmf3.lib" "lib/vtkxdmf3.lib" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}" )
string ( REPLACE "bin/../vtkxdmf3.dll" "bin/vtkxdmf3.dll" VTK_TARGETS_DEBUG_CONTENT "${VTK_TARGETS_DEBUG_CONTENT}" )
file ( WRITE ${ CURRENT_PACKAGES_DIR } /share/vtk/VTKTargets-debug.cmake "${VTK_TARGETS_DEBUG_CONTENT}" )
endif ( )
# For VTK `vcpkg_fixup_cmake_targets` is not enough:
2017-08-10 17:56:23 +08:00
# Files for system third party dependencies are written to modules that
# are located in the paths `share/vtk/Modules` and `debug/share/vtk/Modules`.
# In the release folder, only the release libraries are referenced (e.g. "C:/vcpkg/installed/x64-windows/lib/zlib.lib").
# But in the debug folder both libraries (e.g. "optimized;C:/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/vcpkg/installed/x64-windows/debug/lib/zlibd.lib")
# or only the debug library (e.g. "C:/vcpkg/installed/x64-windows/debug/lib/hdf5_D.lib") is referenced.
# This is because VCPKG appends only the release library prefix (.../x64-windows/lib)
# when configuring release but both (.../x64-windows/lib and .../x64-windows/debug/lib)
# when configuring debug.
# Now if we delete the debug/share/Modules folder and just leave share/Modules, a library
# that links to VTK will always use the release third party dependencies, even if
# debug VTK is used.
#
# The following code merges the libraries from both release and debug:
2017-01-12 18:03:02 +08:00
2017-08-10 21:29:42 +08:00
include ( ${ CMAKE_CURRENT_LIST_DIR } /SplitLibraryConfigurations.cmake )
2017-08-10 17:56:23 +08:00
function ( _vtk_combine_third_party_libraries MODULE_NAME )
set ( MODULE_LIBRARIES_REGEX "set\\(${MODULE_NAME}_LIBRARIES \" ( [^\ "]*)\" \\)")
# Read release libraries
file ( READ "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/${MODULE_NAME}.cmake" RELEASE_MODULE_CONTENT )
if ( "${RELEASE_MODULE_CONTENT}" MATCHES "${MODULE_LIBRARIES_REGEX}" )
set ( RELEASE_LIBRARY_LIST "${CMAKE_MATCH_1}" )
else ( )
message ( FATAL_ERROR "Could not extract module libraries for ${MODULE_NAME}" )
endif ( )
# Read debug libraries
file ( READ "${CURRENT_PACKAGES_DIR}/debug/share/vtk/Modules/${MODULE_NAME}.cmake" DEBUG_MODULE_CONTENT )
if ( "${DEBUG_MODULE_CONTENT}" MATCHES "${MODULE_LIBRARIES_REGEX}" )
set ( DEBUG_LIBRARY_LIST "${CMAKE_MATCH_1}" )
else ( )
message ( FATAL_ERROR "Could not extract module libraries for ${MODULE_NAME}" )
endif ( )
2017-08-10 21:29:42 +08:00
split_library_configurations ( "${RELEASE_LIBRARY_LIST}" OPTIMIZED_RELEASE_LIBRARIES DEBUG_RELEASE_LIBRARIES GENERAL_RELEASE_LIBRARIES )
split_library_configurations ( "${DEBUG_LIBRARY_LIST}" OPTIMIZED_DEBUG_LIBRARIES DEBUG_DEBUG_LIBRARIES GENERAL_DEBUG_LIBRARIES )
# Combine libraries and wrap them in generator expressions
foreach ( LIBRARY ${ OPTIMIZED_RELEASE_LIBRARIES } ${ GENERAL_RELEASE_LIBRARIES } )
list ( APPEND LIBRARY_LIST "$<$<NOT:$<CONFIG:Debug>>:${LIBRARY}>" )
endforeach ( )
foreach ( LIBRARY ${ DEBUG_DEBUG_LIBRARIES } ${ GENERAL_DEBUG_LIBRARIES } )
list ( APPEND LIBRARY_LIST "$<$<CONFIG:Debug>:${LIBRARY}>" )
endforeach ( )
2017-08-10 17:56:23 +08:00
# Write combined libraries back
string ( REGEX REPLACE "${MODULE_LIBRARIES_REGEX}"
" set ( ${ MODULE_NAME } _LIBRARIES \"${LIBRARY_LIST}\")"
R E L E A S E _ M O D U L E _ C O N T E N T
" $ { R E L E A S E _ M O D U L E _ C O N T E N T } "
)
file ( WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/Modules/${MODULE_NAME}.cmake" "${RELEASE_MODULE_CONTENT}" )
endfunction ( )
# IMPORTANT: Please make sure to extend this list whenever a new library is marked `USE_SYSTEM` in the configure step above!
set ( SYSTEM_THIRD_PARTY_MODULES
v t k e x p a t
v t k f r e e t y p e
2017-08-11 03:58:44 +08:00
v t k j p e g
2017-08-10 17:56:23 +08:00
v t k g l e w
v t k h d f 5
v t k j s o n c p p
2017-08-11 03:58:44 +08:00
v t k l i b p r o j 4
2017-08-10 17:56:23 +08:00
v t k l i b x m l 2
2017-08-11 03:58:44 +08:00
v t k l z 4
2017-08-11 16:17:32 +08:00
v t k o g g t h e o r a
2017-08-10 17:56:23 +08:00
v t k p n g
v t k t i f f
v t k z l i b
2017-08-28 16:48:30 +08:00
# vtkgl2ps
v t k l i b h a r u
2017-08-10 17:56:23 +08:00
)
2017-08-28 16:48:30 +08:00
if ( VTK_WITH_PYTHON OR VTK_WITH_ALL_MODULES )
list ( APPEND SYSTEM_THIRD_PARTY_MODULES
v t k P y t h o n
)
endif ( )
if ( VTK_WITH_ALL_MODULES )
list ( APPEND SYSTEM_THIRD_PARTY_MODULES
A u t o b a h n P y t h o n
)
endif ( )
2017-08-10 17:56:23 +08:00
foreach ( MODULE IN LISTS SYSTEM_THIRD_PARTY_MODULES )
_vtk_combine_third_party_libraries ( "${MODULE}" )
endforeach ( )
2017-08-10 23:05:43 +08:00
# Remove all explicit references to vcpkg system libraries in the general VTKTargets.cmake file
# since these references always point to the release libraries, even in the debug case.
# The dependencies should be handled by the explicit modules we fixed above, so removing
# them here shouldn't cause any problems.
file ( READ "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets.cmake" VTK_TARGETS_CONTENT )
string ( REGEX REPLACE "${CURRENT_INSTALLED_DIR}/lib/[^\\.]*\\.lib" "" VTK_TARGETS_CONTENT "${VTK_TARGETS_CONTENT}" )
file ( WRITE "${CURRENT_PACKAGES_DIR}/share/vtk/VTKTargets.cmake" "${VTK_TARGETS_CONTENT}" )
2018-10-26 02:47:58 +08:00
# Remove any remaining stray absolute references to the installed directory.
file ( GLOB_RECURSE CMAKE_FILES ${ CURRENT_PACKAGES_DIR } /share/vtk/*.cmake )
foreach ( FILE IN LISTS CMAKE_FILES )
file ( READ "${FILE}" _contents )
string ( REPLACE "${CURRENT_INSTALLED_DIR}" "\${VTK_INSTALL_PREFIX}" _contents "${_contents}" )
file ( WRITE "${FILE}" "${_contents}" )
endforeach ( )
2017-08-28 16:48:30 +08:00
# =============================================================================
2018-04-30 22:02:11 +08:00
# Clean-up other directories
2017-01-12 18:03:02 +08:00
2019-02-22 03:47:54 +08:00
# 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 ( )
2017-08-28 16:48:30 +08:00
2019-02-22 03:47:54 +08:00
# 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 } )
2018-04-30 22:02:11 +08:00
endif ( )
2019-02-22 03:47:54 +08:00
# 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}" )
2017-08-28 16:48:30 +08:00
endfunction ( )
set ( VTK_TOOLS
v t k E n c o d e S t r i n g - $ { V T K _ S H O R T _ V E R S I O N }
v t k H a s h S o u r c e - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p T c l I n i t - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p T c l - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p P y t h o n I n i t - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p P y t h o n - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p J a v a - $ { V T K _ S H O R T _ V E R S I O N }
v t k W r a p H i e r a r c h y - $ { V T K _ S H O R T _ V E R S I O N }
v t k P a r s e J a v a - $ { V T K _ S H O R T _ V E R S I O N }
v t k P a r s e O G L E x t - $ { V T K _ S H O R T _ V E R S I O N }
v t k p y t h o n
p v t k p y t h o n
)
2019-02-22 03:47:54 +08:00
foreach ( TOOL_NAME IN LISTS VTK_TOOLS )
_vtk_remove_debug_tool ( "${TOOL_NAME}" )
_vtk_move_release_tool ( "${TOOL_NAME}" )
endforeach ( )
2017-11-10 17:23:10 +08:00
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}" )
2017-08-28 16:48:30 +08:00
# =============================================================================
# Remove other files and directories that are not valid for vcpkg
if ( VTK_WITH_ALL_MODULES )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /XdmfConfig.cmake )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/XdmfConfig.cmake )
endif ( )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2017-08-06 17:37:27 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/bin )
endif ( )
2017-01-12 18:03:02 +08:00
2017-08-10 17:56:23 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
2017-08-28 16:48:30 +08:00
# =============================================================================
2017-01-12 18:03:02 +08:00
# 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 )
2019-02-22 03:47:54 +08:00
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/vtk )