2024-04-29 21:01:01 +08:00
set ( VTK_SHORT_VERSION 9.3 )
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 )
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
2024-06-19 08:07:09 +08:00
R E F 0 9 a 7 6 b c 5 5 b 3 7 c a a d 9 4 d 0 d 8 e b e 8 6 5 c a a e d 1 b 4 3 8 a f # v9.3.x used by ParaView 5.12.0
S H A 5 1 2 3 9 6 e e 9 0 1 f a f a c a e 8 a e f 8 6 0 b 9 c 9 c 1 7 c b 9 2 a e 8 b 4 9 6 9 5 2 7 f d 2 7 1 a d 8 d d 9 f 6 a 9 e 0 d c 8 e 3 d c 8 0 7 c 8 d 4 3 c c 5 8 5 6 0 8 a d 1 0 1 a 6 4 e d c d 7 a f f 4 9 e 1 5 8 0 c 7 a 6 1 a 8 1 7 c 2 e a 8 e 2 6 5 5 f 5
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
2023-06-27 13:49:51 +08:00
l i b p r o j . p a t c h
2021-10-12 02:01:04 +08:00
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
2024-04-29 21:01:01 +08:00
f a s t - f l o a t . p a t c h
f i x - e x p r t k . p a t c h # just for dbow2 and theia
d e v e n d o r _ e x o d u s I I . p a t c h
2024-04-02 04:32:08 +08:00
r e m o v e - p r e f i x - c h a n g e s . p a t c h
2024-05-09 02:12:20 +08:00
h d f 5 h e l p e r . p a t c h
2024-05-28 05:31:08 +08:00
o p e n c a s c a d e - 7 . 8 . 0 . p a t c h
2024-08-14 11:27:07 +08:00
n o - l i b h a r u - f o r - i o e x p o r t . p a t c h
n o - l i b p r o j - f o r - n e t c d f . 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
2024-05-01 02:50:26 +08:00
file ( REMOVE "${SOURCE_PATH}/CMake/FindOGG.cmake" )
vcpkg_replace_string ( "${SOURCE_PATH}/ThirdParty/ogg/CMakeLists.txt" "OGG::OGG" "Ogg::ogg" )
vcpkg_replace_string ( "${SOURCE_PATH}/ThirdParty/ogg/CMakeLists.txt" "OGG" "Ogg" )
vcpkg_replace_string ( "${SOURCE_PATH}/CMake/vtkInstallCMakePackage.cmake" "FindOGG.cmake\n" "" )
vcpkg_replace_string ( "${SOURCE_PATH}/CMake/FindTHEORA.cmake" "find_dependency(OGG)" "find_dependency(Ogg CONFIG)" )
vcpkg_replace_string ( "${SOURCE_PATH}/CMake/FindTHEORA.cmake" "OGG::OGG" "Ogg::ogg" )
2021-10-12 02:01:04 +08:00
# =============================================================================
2017-08-28 16:48:30 +08:00
2023-04-05 03:10:32 +08:00
if ( HDF5_WITH_PARALLEL AND NOT "mpi" IN_LIST FEATURES )
message ( WARNING "${HDF5_WITH_PARALLEL} Enabling MPI in vtk." )
list ( APPEND FEATURES "mpi" )
endif ( )
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
2024-04-29 21:01:01 +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 _ I O H 5 R a g e
2021-10-12 02:01:04 +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 _ 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
2024-04-29 21:01:01 +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 _ F i l t e r s O p e n T U R N 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 _ F i l t e r s P a r a l l e l V e r d i c 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 O M F
" 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 I O
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
2024-05-28 05:31:08 +08:00
" i o o c c t " V T K _ M O D U L E _ E N A B L E _ V T K _ I O O C C T
2024-08-14 11:27:07 +08:00
" l i b t h e o r a " V T K _ M O D U L E _ E N A B L E _ V T K _ I O O g g T h e o r a
" l i b h a r u " V T K _ M O D U L E _ E N A B L E _ V T K _ I O E x p o r t P D F
" c g n s " V T K _ M O D U L E _ E N A B L E _ V T K _ I O C G N S R e a d e r
" s e a c a s " V T K _ M O D U L E _ E N A B L E _ V T K _ I O I O S S
" s e a c a s " V T K _ M O D U L E _ E N A B L E _ V T K _ I O E x o d u s
" s q l " V T K _ M O D U L E _ E N A B L E _ V T K _ I O S Q L
" p r o j " V T K _ M O D U L E _ E N A B L E _ V T K _ I O C e s i u m 3 D T i l e s
" p r o j " V T K _ M O D U L E _ E N A B L E _ V T K _ G e o v i s C o r e
" n e t c d f " V T K _ M O D U L E _ E N A B L E _ V T K _ I O N e t C D F
" n e t c d f " V T K _ M O D U L E _ E N A B L E _ V T K _ I O M I N C
)
# Require port features to prevent accidental finding of transitive dependencies
vcpkg_check_features ( OUT_FEATURE_OPTIONS PACKAGE_FEATURE_OPTIONS
F E A T U R E S
" l i b t h e o r a " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ T H E O R A
" l i b h a r u " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ L i b H a r u
" c g n s " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ C G N S
" s e a c a s " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S E A C A S I o s s
" s e a c a s " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S E A C A S E x o d u s
" s q l " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S Q L i t e 3
" p r o j " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ P R O J
" n e t c d f " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ N e t C D F
I N V E R T E D _ F E A T U R E S
" l i b t h e o r a " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ T H E O R A
" l i b h a r u " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ L i b H a r u
" c g n s " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ C G N S
" s e a c a s " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S E A C A S I o s s
" s e a c a s " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S E A C A S E x o d u s
" s q l " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S Q L i t e 3
" p r o j " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ P R O J
" n e t c d f " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ N e t C D F
2021-10-12 02:01:04 +08:00
)
# 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
2024-04-29 21:01:01 +08:00
if ( "qt" IN_LIST FEATURES AND NOT EXISTS "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/qmlplugindump${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
2023-01-20 09:55:56 +08:00
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 )
2024-04-29 21:01:01 +08:00
file ( GLOB _py3_include_path "${CURRENT_INSTALLED_DIR}/include/python3*" )
2023-08-08 04:19:53 +08:00
string ( REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${ _py3_include_path } )
set ( PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}" )
set ( python_ver "3.${PYTHON_VERSION_MINOR}" )
2023-01-20 09:55:56 +08:00
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
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
2024-04-29 21:01:01 +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 _ 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 } "
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 _ 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
2024-04-29 21:01:01 +08:00
- D V T K _ P Y T H O N _ S I T E _ P A C K A G E S _ S U F F I X = $ { P Y T H O N 3 _ S I T E }
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
2024-04-29 21:01:01 +08:00
- D V T K _ M O D U L E _ E N A B L E _ V T K _ W e b 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 _ R e n d e r i n g M a t p l o t l i b = Y E S
2023-01-20 09:55:56 +08:00
)
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
2024-04-29 21:01:01 +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 P a r a l l e l L I C = 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 }
2024-08-14 11:27:07 +08:00
$ { P A C K A G E _ 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
2024-04-29 21:01:01 +08:00
- D V T K _ M O D U L E _ U S E _ E X T E R N A L _ V T K _ t o k e n : 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
2024-08-14 11:27:07 +08:00
# When working properly these should be unused
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ C G N S
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ L i b H a r u
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ N e t C D F
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ P R O J
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S E A C A S E x o d u s
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S E A C A S I o s s
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ S Q L i t e 3
C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ T H E O R A
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ C G N S
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ L i b H a r u
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ N e t C D F
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ P R O J
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S E A C A S E x o d u s
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S E A C A S I o s s
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ S Q L i t e 3
C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ T H E O R A
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 ( )
2024-04-29 21:01:01 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin/vtktoken-9.3.dll" AND VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
# vendored "token" library can be only build as a shared library
set ( VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled )
elseif ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
file ( REMOVE_RECURSE
" $ { C U R R E N T _ P A C K A G E S _ D I R } / b i n "
" $ { 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" )
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" )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}/vtkChemistryConfigure.h" "${SOURCE_PATH}" "not/existing" IGNORE_UNCHANGED )
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
2024-06-19 08:07:09 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/Copyright.txt" )
2024-04-29 21:01:01 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/share/vtk/VTK-vtk-module-properties.cmake" "_vtk_module_import_prefix}/lib/vtk-9.3/hierarchy" "_vtk_module_import_prefix}$<$<CONFIG:Debug>:/debug>/lib/vtk-9.3/hierarchy" )