2023-01-20 09:55:56 +08:00
set ( VTK_SHORT_VERSION 9.2 )
2020-03-05 05:34:17 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
2018-12-18 04:09:44 +08:00
message ( WARNING "You will need to install Xorg dependencies to build vtk:\napt-get install libxt-dev\n" )
endif ( )
2023-01-25 11:58:39 +08:00
set ( VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled )
2023-01-20 09:55:56 +08:00
vcpkg_download_distfile (
S T R I N G _ P A T C H
U R L S h t t p s : / / g i t l a b . k i t w a r e . c o m / v t k / v t k / - / c o m m i t / b f a 3 e 4 c 7 6 2 1 d d f 5 8 2 6 7 5 5 5 3 6 e b 0 7 2 8 4 c 8 6 d b 6 4 7 4 . d i f f
F I L E N A M E v t k - s t r i n g - b f a 3 e 4 . d i f f
S H A 5 1 2 c 5 c c b 1 1 9 3 e 4 e 6 1 c f 7 8 b 6 3 8 0 2 f 8 7 f f b 0 9 3 4 9 c 5 5 6 6 a d 8 a 4 d 5 1 4 1 8 1 3 3 9 5 3 f 7 a c d 6 b 4 a 2 0 6 f 8 d 4 1 a 4 2 6 a 9 e b 9 b e 3 c f 1 f d 9 5 2 4 2 e 6 4 0 2 9 7 3 2 5 2 d 7 9 7 9 e 5 a 9 c b 5 e 5 e 4 8 0 d 7 8
)
2021-10-12 02:01:04 +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
2023-01-20 09:55:56 +08:00
R E F 6 6 1 4 3 e f 0 4 1 b 9 8 0 a 5 1 e 4 1 e e 4 7 0 d 0 5 3 e 6 7 2 0 9 1 5 0 f 8 # v9.2.x used by ParaView 5.11.0
S H A 5 1 2 7 0 6 6 2 6 7 0 6 2 2 0 8 2 b b 8 d 8 b 1 6 7 6 5 b b d f 6 4 5 c f b e 6 2 1 5 1 e 9 3 b 9 6 7 3 c 6 f 9 4 b 3 5 6 d f 6 6 c a 0 0 3 e 5 c 7 8 b 4 5 e 9 9 3 8 5 f 1 6 3 0 a e d 3 9 c 3 a 8 e d d e c d 1 d 9 f 5 b c 0 c f b 9 2 f 5 e 7 e 8 c 0 6 e 4 d b b
2021-10-12 02:01:04 +08:00
H E A D _ R E F m a s t e r
P A T C H E S
F i n d L Z M A . p a t c h
F i n d L Z 4 . p a t c h
F i n d p r o j . p a t c h
p e g t l . p a t c h
p y t h o n w r a p p e r . p a t c h # Required by ParaView to Wrap required classes
N o U n d e f D e b u g . p a t c h # Required to link against correct Python library depending on build type.
f i x - u s i n g - h d f 5 . p a t c h
# CHECK: module-name-mangling.patch
# Last patch TODO: Patch out internal loguru
F i n d E x p a t . p a t c h # The find_library calls are taken care of by vcpkg-cmake-wrapper.cmake of expat
2023-01-20 09:55:56 +08:00
# fix-gdal.patch TODO?
c g n s . p a t c h
v t k m . p a t c h
a f x d l l . p a t c h
v t k i o s s . p a t c h
j s o n c p p . p a t c h
i o t r . p a t c h
$ { S T R I N G _ P A T C H }
2021-10-12 02:01:04 +08:00
)
# =============================================================================
#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
# =============================================================================
2017-08-28 16:48:30 +08:00
# =============================================================================
2020-05-12 04:39:50 +08:00
# Options:
2017-08-28 16:48:30 +08:00
# Collect CMake options for optional components
2020-05-12 04:39:50 +08:00
2023-01-20 09:55:56 +08:00
if ( "atlmfc" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ M O D U L E _ E N A B L E _ V T K _ G U I S u p p o r t M F C = Y E S
)
endif ( )
if ( "vtkm" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m C o r e = Y E S
- D V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m D a t a M o d e l = Y E S
- D V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m F i l t e r s = Y E S
- D V T K _ M O D U L E _ E N A B L E _ V T K _ v t k m = Y E S
)
endif ( )
2021-10-12 02:01:04 +08:00
# TODO:
# - add loguru as a dependency requires #8682
vcpkg_check_features ( OUT_FEATURE_OPTIONS VTK_FEATURE_OPTIONS
F E A T U R E S
" q t " V T K _ G R O U P _ E N A B L E _ Q t
" q t " V T K _ M O D U L E _ E N A B L E _ V T K _ G U I S u p p o r t Q t
" q t " V T K _ M O D U L E _ E N A B L E _ V T K _ G U I S u p p o r t Q t S Q L
" q t " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g Q t
" q t " V T K _ M O D U L E _ E N A B L E _ V T K _ V i e w s Q t
" a t l m f c " V T K _ M O D U L E _ E N A B L E _ V T K _ G U I S u p p o r t M F C
" v t k m " V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m C o r e
" v t k m " V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m D a t a M o d e l
" v t k m " V T K _ M O D U L E _ E N A B L E _ V T K _ A c c e l e r a t o r s V T K m F i l t e r s
" v t k m " V T K _ M O D U L E _ E N A B L E _ V T K _ v t k m
" p y t h o n " V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n
" p y t h o n " V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n C o n t e x t 2 D
" p y t h o n " V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n I n t e r p r e t e r
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ F i l t e r s P a r a l l e l S t a t i s t i c s
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O P a r a l l e l E x o d u s
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g P a r a l l e l
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g V o l u m e A M R
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O X d m f 2
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O H 5 p a r t
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O P a r a l l e l L S D y n a
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O T R U C H A S
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ I O V P I C
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g A n n o t a t i o n
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ D o m a i n s C h e m i s t r y
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ F i l t e r s P a r a l l e l D I Y 2
2023-01-20 09:55:56 +08:00
" p a r a v i e w " V T K _ M O D U L E _ E N A B L E _ V T K _ c l i 1 1
2021-10-12 02:01:04 +08:00
" m p i " V T K _ G R O U P _ E N A B L E _ M P I
" o p e n g l " V T K _ M O D U L E _ E N A B L E _ V T K _ I m a g i n g O p e n G L 2
" o p e n g l " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g G L 2 P S O p e n G L 2
" o p e n g l " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g O p e n G L 2
" o p e n g l " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g V o l u m e O p e n G L 2
" o p e n g l " V T K _ M O D U L E _ E N A B L E _ V T K _ o p e n g l
" o p e n v r " V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g O p e n V R
" g d a l " V T K _ M O D U L E _ E N A B L E _ V T K _ I O G D A L
" g e o j s o n " V T K _ M O D U L E _ E N A B L E _ V T K _ I O G e o J S O N
)
# Replace common value to vtk value
list ( TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=ON" "=YES" )
list ( TRANSFORM VTK_FEATURE_OPTIONS REPLACE "=OFF" "=DONT_WANT" )
2017-08-28 16:48:30 +08:00
2023-01-20 09:55:56 +08:00
if ( "qt" IN_LIST FEATURES AND NOT EXISTS "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt5/bin/qmlplugindump${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
list ( APPEND VTK_FEATURE_OPTIONS -DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick=NO )
endif ( )
2023-01-27 11:19:30 +08:00
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 ( )
endif ( )
2023-01-20 09:55:56 +08:00
2020-05-12 04:39:50 +08:00
if ( "python" IN_LIST FEATURES )
2023-01-20 09:55:56 +08:00
set ( python_ver "" )
if ( NOT VCPKG_TARGET_IS_WINDOWS )
set ( python_ver 3.10 )
endif ( )
2017-08-28 16:48:30 +08:00
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
2020-05-12 04:39:50 +08:00
- D P y t h o n 3 _ F I N D _ R E G I S T R Y = N E V E R
2023-01-20 09:55:56 +08:00
" - D P y t h o n 3 _ E X E C U T A B L E : P A T H = $ { C U R R E N T _ H O S T _ I N S T A L L E D _ D I R } / t o o l s / p y t h o n 3 / p y t h o n $ { p y t h o n _ v e r } $ { V C P K G _ E X E C U T A B L E _ S U F F I X } "
- D V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n = Y E S
- D V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n C o n t e x t 2 D = Y E S # TODO: recheck
- D V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n I n t e r p r e t e r = Y E S
2017-08-28 16:48:30 +08:00
)
2020-05-12 04:39:50 +08:00
#VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages
2017-08-28 16:48:30 +08:00
endif ( )
2021-10-12 02:01:04 +08:00
if ( "paraview" IN_LIST FEATURES OR "opengl" IN_LIST FEATURES )
2017-08-28 16:48:30 +08:00
list ( APPEND ADDITIONAL_OPTIONS
2020-05-12 04:39:50 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g C o n t e x t O p e n G L 2 = Y E S
- D V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g L I C O p e n G L 2 = Y E S
2023-01-20 09:55:56 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ R e n d e r i n g A n n o t a t i o n = Y E S
2020-06-24 01:20:18 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ D o m a i n s C h e m i s t r y O p e n G L 2 = Y E S
2023-01-20 09:55:56 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ F i l t e r s P a r a l l e l D I Y 2 = Y E S
2017-08-28 16:48:30 +08:00
)
endif ( )
2017-08-11 00:20:40 +08:00
2023-01-20 09:55:56 +08:00
if ( "paraview" IN_LIST FEATURES AND "python" IN_LIST FEATURES )
2020-05-12 04:39:50 +08:00
list ( APPEND ADDITIONAL_OPTIONS
2023-01-20 09:55:56 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ W e b C o r e = Y E S
)
endif ( )
if ( "paraview" IN_LIST FEATURES AND "mpi" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ M O D U L E _ E N A B L E _ V T K _ F i l t e r s P a r a l l e l F l o w P a t h s = Y E S
2020-08-28 13:28:30 +08:00
)
endif ( )
if ( "mpi" IN_LIST FEATURES AND "python" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ M O D U L E _ U S E _ E X T E R N A L _ V T K _ m p i 4 p y = O F F
2020-05-12 04:39:50 +08:00
)
endif ( )
2020-07-22 07:04:45 +08:00
if ( "cuda" IN_LIST FEATURES AND CMAKE_HOST_WIN32 )
vcpkg_add_to_path ( "$ENV{CUDA_PATH}/bin" )
endif ( )
2021-03-27 06:58:02 +08:00
if ( "utf8" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D K W S Y S _ E N C O D I N G _ D E F A U L T _ C O D E P A G E = C P _ U T F 8
)
endif ( )
2020-05-12 04:39:50 +08:00
if ( "all" IN_LIST FEATURES )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ U S E _ T K = O F F # TCL/TK currently not included in vcpkg
2021-10-12 02:01:04 +08:00
- D V T K _ F O R B I D _ D O W N L O A D S = O F F
)
else ( )
list ( APPEND ADDITIONAL_OPTIONS
- D V T K _ F O R B I D _ D O W N L O A D S = O N
2020-05-12 04:39:50 +08:00
)
2020-03-05 05:34:17 +08:00
endif ( )
2020-05-12 04:39:50 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-08-27 01:07:38 +08:00
F E A T U R E S
2023-01-20 09:55:56 +08:00
" c u d a " V T K _ U S E _ C U D A
" m p i " V T K _ U S E _ M P I
" a l l " V T K _ B U I L D _ A L L _ M O D U L E S
2020-05-12 04:39:50 +08:00
)
2022-07-14 01:30:11 +08:00
2017-08-28 16:48:30 +08:00
# =============================================================================
# Configure & Install
2019-03-15 05:38:47 +08:00
2023-01-20 09:55:56 +08:00
2020-05-12 04:39:50 +08:00
# We set all libraries to "system" and explicitly list the ones that should use embedded copies
2021-09-28 11:57:22 +08:00
vcpkg_cmake_configure (
2021-11-13 08:38:22 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2021-10-12 02:01:04 +08:00
O P T I O N S
$ { F E A T U R E _ O P T I O N S }
$ { V T K _ F E A T U R E _ O P T I O N S }
2017-01-12 18:03:02 +08:00
- D B U I L D _ T E S T I N G = O F F
2020-05-12 04:39:50 +08:00
- D V T K _ B U I L D _ T E S T I N G = O F F
- D V T K _ B U I L D _ E X A M P L E S = O F F
2020-07-08 04:56:33 +08:00
- D V T K _ E N A B L E _ R E M O T E _ M O D U L E S = O F F
2020-05-12 04:39:50 +08:00
# VTK groups to enable
- D V T K _ G R O U P _ E N A B L E _ S t a n d A l o n e = Y E S
- D V T K _ G R O U P _ E N A B L E _ R e n d e r i n g = Y E S
- D V T K _ G R O U P _ E N A B L E _ V i e w s = Y E S
# Disable deps not in VCPKG
- D V T K _ U S E _ T K = O F F # TCL/TK currently not included in vcpkg
2019-04-03 17:16:30 +08:00
# Select modules / groups to install
2020-05-12 04:39:50 +08:00
- D V T K _ U S E _ E X T E R N A L : B O O L = O N
- D V T K _ M O D U L E _ U S E _ E X T E R N A L _ V T K _ g l 2 p s : B O O L = O F F # Not yet in VCPKG
2023-01-20 09:55:56 +08:00
#-DVTK_MODULE_ENABLE_VTK_jsoncpp=YES
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 }
2021-10-12 02:01:04 +08:00
- D V T K _ D E B U G _ M O D U L E _ A L L = O N
- D V T K _ D E B U G _ M O D U L E = O N
2023-01-27 11:19:30 +08:00
- D V T K _ Q T _ V E R S I O N = 6
2023-01-20 09:55:56 +08:00
- D C M A K E _ I N S T A L L _ Q M L D I R : P A T H = q m l
- D V C P K G _ H O S T _ T R I P L E T = $ { _ H O S T _ T R I P L E T }
2023-01-27 11:19:30 +08:00
- D C M A K E _ F I N D _ P A C K A G E _ T A R G E T S _ G L O B A L = O N # Due to Qt6::Platform not being found on Linux platform
2023-01-20 09:55:56 +08:00
M A Y B E _ U N U S E D _ V A R I A B L E S
V T K _ M O D U L E _ E N A B L E _ V T K _ P y t h o n C o n t e x t 2 D # Guarded by a conditional
V T K _ M O D U L E _ E N A B L E _ V T K _ G U I S u p p o r t M F C # only windows
V T K _ Q T _ V E R S I O N # Only with Qt
C M A K E _ I N S T A L L _ Q M L D I R
2017-01-12 18:03:02 +08:00
)
2021-09-28 11:57:22 +08:00
vcpkg_cmake_install ( )
2017-01-12 18:03:02 +08:00
vcpkg_copy_pdbs ( )
2017-08-28 16:48:30 +08:00
# =============================================================================
# Fixup target files
2023-01-20 09:55:56 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/vtk- ${ VTK_SHORT_VERSION } )
2017-01-12 18:03:02 +08:00
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 )
2021-08-31 01:03:01 +08:00
set ( filename "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" )
if ( EXISTS "${filename}" )
file ( REMOVE "${filename}" )
2019-02-22 03:47:54 +08:00
endif ( )
2021-08-31 01:03:01 +08:00
set ( filename "${CURRENT_PACKAGES_DIR}/debug/bin/${TOOL_NAME}d${VCPKG_TARGET_EXECUTABLE_SUFFIX}" )
if ( EXISTS "${filename}" )
file ( REMOVE "${filename}" )
2019-02-22 03:47:54 +08:00
endif ( )
2020-06-02 06:58:55 +08:00
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 ( )
2019-02-22 03:47:54 +08:00
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 )
2020-05-12 04:39:50 +08:00
set ( old_filename "${CURRENT_PACKAGES_DIR}/bin/${TOOL_NAME}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" )
2021-08-31 01:03:01 +08:00
if ( EXISTS "${old_filename}" )
file ( INSTALL "${old_filename}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/vtk" USE_SOURCE_PERMISSIONS )
file ( REMOVE "${old_filename}" )
2019-02-22 03:47:54 +08:00
endif ( )
2020-05-12 04:39:50 +08:00
2020-06-02 06:58:55 +08:00
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 ( )
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 }
2020-05-12 04:39:50 +08:00
v t k P r o b e O p e n G L V e r s i o n - $ { V T K _ S H O R T _ V E R S I O N }
v t k T e s t O p e n G L V e r s i o n - $ { V T K _ S H O R T _ V E R S I O N }
2017-08-28 16:48:30 +08:00
v t k p y t h o n
p v t k p y t h o n
)
2020-05-12 04:39:50 +08:00
# 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
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 ( )
2019-04-03 17:16:30 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2021-08-31 01:03:01 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin"
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n " )
2017-08-06 17:37:27 +08:00
endif ( )
2017-01-12 18:03:02 +08:00
2021-08-31 01:03:01 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2017-08-10 17:56:23 +08:00
2020-05-12 04:39:50 +08:00
vcpkg_copy_tool_dependencies ( "${CURRENT_PACKAGES_DIR}/tools/vtk" )
## Files Modules needed by ParaView
if ( "paraview" IN_LIST FEATURES )
2020-12-12 06:16:29 +08:00
set ( VTK_CMAKE_NEEDED vtkCompilerChecks vtkCompilerPlatformFlags vtkCompilerExtraFlags vtkInitializeBuildType
2021-08-31 01:03:01 +08:00
v t k S u p p o r t M a c r o s v t k V e r s i o n F i n d P y t h o n M o d u l e s v t k M o d u l e D e b u g g i n g v t k E x t e r n a l D a t a )
2020-05-12 04:39:50 +08:00
foreach ( module ${ VTK_CMAKE_NEEDED } )
2020-06-24 01:20:18 +08:00
file ( INSTALL "${SOURCE_PATH}/CMake/${module}.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk" )
2020-05-12 04:39:50 +08:00
endforeach ( )
2020-12-12 06:16:29 +08:00
2020-06-24 01:20:18 +08:00
## Check List on UPDATE !!
file ( INSTALL "${SOURCE_PATH}/CMake/vtkRequireLargeFilesSupport.cxx" DESTINATION "${CURRENT_PACKAGES_DIR}/share/vtk" )
2021-08-31 01:03:01 +08:00
file ( INSTALL "${SOURCE_PATH}/Rendering/Volume/vtkBlockSortHelper.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}" ) # this should get installed by VTK
file ( INSTALL "${SOURCE_PATH}/Filters/ParallelDIY2/vtkDIYKdTreeUtilities.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}" )
2020-06-24 01:20:18 +08:00
2023-01-20 09:55:56 +08:00
file ( INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Rendering/Parallel/vtkCompositeZPassFS.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}" )
2020-06-24 01:20:18 +08:00
file ( INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Rendering/OpenGL2/vtkTextureObjectVS.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}" )
2021-08-31 01:03:01 +08:00
2020-05-12 04:39:50 +08:00
endif ( )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2021-11-13 08:38:22 +08:00
if ( EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/vtkpythonmodules/static_python" ) #python headers
2020-06-24 01:20:18 +08:00
file ( GLOB_RECURSE STATIC_PYTHON_FILES "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/CMakeFiles/*/static_python/*.h" )
2021-11-13 08:38:22 +08:00
file ( INSTALL ${ STATIC_PYTHON_FILES } DESTINATION "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}" )
2020-05-12 04:39:50 +08:00
endif ( )
endif ( )
2020-12-12 06:16:29 +08:00
2020-05-12 04:39:50 +08:00
#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 )
2020-12-12 06:16:29 +08:00
string ( REPLACE
2020-05-12 04:39:50 +08:00
[ [ 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}" ) ] ] _ c o n t e n t s " $ { _ c o n t e n t s } " )
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 ( )
2020-12-12 06:16:29 +08:00
2021-09-28 11:57:22 +08:00
# Use vcpkg provided find method
file ( REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindEXPAT.cmake" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/share/licenses" "${CURRENT_PACKAGES_DIR}/share/${PORT}/licenses" )
2023-01-20 09:55:56 +08:00
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" )
2022-01-14 01:14:32 +08:00
endif ( )
2020-12-12 06:16:29 +08:00
# =============================================================================
2021-09-28 11:57:22 +08:00
# Usage
configure_file ( "${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY )
2020-12-12 06:16:29 +08:00
# Handle copyright
2021-11-19 13:42:18 +08:00
file ( INSTALL "${SOURCE_PATH}/Copyright.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright" )