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 ( )
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
R E F 2 9 5 9 4 1 3 f f 1 9 0 b c 6 e 3 f f 4 0 f 5 b 6 c 1 3 4 2 e d d 2 e 5 2 3 3 f # v9.0.x used by ParaView 5.9.1
S H A 5 1 2 1 6 2 2 9 c 1 0 7 e d 9 0 4 e 8 f a 6 8 5 0 c 3 8 1 4 b 8 b d c d f 9 7 0 0 e f 4 4 f 6 f f 5 b 3 a 7 7 e 7 d 7 9 3 c e 1 9 9 5 4 f c 2 c 7 b 1 2 1 9 a 0 1 6 2 c f 5 8 8 d e f 6 e 9 9 0 8 8 3 c d 3 f 8 0 8 c 3 1 6 a 4 d b 6 e 6 5 b d 6 c d 1 7 6 9 d d 3 f
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.
p y t h o n _ d e b u g . p a t c h
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
# upstream vtkm patches to make it work with vtkm 1.6
v t k m . p a t c h # To include an external VTKm build
1 f 0 0 a 0 c 9 . p a t c h
1 5 6 f b 5 2 4 . p a t c h
d 1 0 7 6 9 8 a . p a t c h
f i x - g d a l . p a t c h
2021-11-13 08:38:22 +08:00
m i s s i n g - l i m i t s . p a t c h # This patch can be removed in next version. Since it has been merged to upstream via https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7611
2021-11-19 13:42:18 +08:00
U s e P r o j 5 A p i . p a t c h # Allow Proj 8.0+ (commit b66e4a7, backported). Should be in soon after 9.0.3
2022-07-14 01:30:11 +08:00
f i x - f i n d - l i b h a r u . p a t c h
2022-10-01 05:52:19 +08:00
f i x - l i b h a r u 2 . 4 - c o m p a t . 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
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
" 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
2020-05-12 04:39:50 +08:00
if ( "python" IN_LIST FEATURES )
2019-09-27 01:10:49 +08:00
vcpkg_find_acquire_program ( PYTHON3 )
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
" - D P y t h o n 3 _ E X E C U T A B L E : P A T H = $ { P Y T H O N 3 } "
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
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
2017-08-28 16:48:30 +08:00
)
endif ( )
2017-08-11 00:20:40 +08:00
2021-10-12 02:01:04 +08:00
if ( "paraview" IN_LIST FEATURES AND "python" IN_LIST FEATURES )
2020-05-12 04:39:50 +08:00
list ( APPEND ADDITIONAL_OPTIONS
2021-10-12 02:01:04 +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 M a t p l o t l i b = 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
" c u d a " V T K _ U S E _ C U D A
2021-10-12 02:01:04 +08:00
" m p i " V T K _ U S E _ M P I
2021-08-27 01:07:38 +08:00
" 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
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
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
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
2021-09-28 11:57:22 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/vtk-9.0 )
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 ( )
2020-05-12 04:39:50 +08:00
set ( VTK_SHORT_VERSION 9.0 )
2017-08-28 16:48:30 +08:00
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}" )
file ( INSTALL "${SOURCE_PATH}/Parallel/DIY/vtkDIYUtilities.txx" 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" )
2022-01-14 01:14:32 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/include/vtk-9.0/vtkChemistryConfigure.h" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/vtk-9.0/vtkChemistryConfigure.h" "${SOURCE_PATH}" "not/existing" )
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" )