2020-09-05 22:19:43 +08:00
# highfive should be updated together with hdf5
2024-06-03 12:59:19 +08:00
string ( REPLACE "." "." hdf5_ref "hdf5_${VERSION}" )
2020-06-24 03:58:50 +08:00
vcpkg_from_github (
2019-03-15 05:29:33 +08:00
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
2021-05-07 04:52:01 +08:00
R E P O H D F G r o u p / h d f 5
2023-10-04 11:38:06 +08:00
R E F " $ { h d f 5 _ r e f } "
2024-06-03 12:59:19 +08:00
S H A 5 1 2 7 7 8 4 9 b 6 4 4 f 5 3 1 2 e a e 5 a 3 f 2 f e 4 5 6 6 6 d 9 d f 9 5 c c 2 1 b 0 9 2 2 0 7 d a e 0 1 c a 7 d 0 1 9 e 4 2 8 2 5 5 d 7 5 f e 0 c 2 7 5 3 8 e 4 1 0 1 e a b f 2 0 3 0 9 2 7 a 7 3 c e a e c 8 e 1 4 7 1 c 7 2 b 5 1 f e d 5 3 7 0 8 1 0 f 9 a 3 5
2020-06-24 03:58:50 +08:00
H E A D _ R E F d e v e l o p
2021-05-07 04:52:01 +08:00
P A T C H E S
2021-06-10 06:17:07 +08:00
h d f 5 _ c o n f i g . p a t c h
s z i p . p a t c h
2017-02-28 17:09:04 +08:00
)
2021-10-27 13:38:05 +08:00
set ( ALLOW_UNSUPPORTED OFF )
2020-01-07 06:13:34 +08:00
if ( "parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES )
2023-10-04 11:38:06 +08:00
message ( WARNING "Feature 'Parallel' and 'cpp' are mutually exclusive, enabling option ALLOW_UNSUPPORTED automatically to enable them both." )
2021-10-27 13:38:05 +08:00
set ( ALLOW_UNSUPPORTED ON )
endif ( )
if ( "threadsafe" IN_LIST FEATURES AND
( " p a r a l l e l " I N _ L I S T F E A T U R E S
O R " f o r t r a n " I N _ L I S T F E A T U R E S
O R " c p p " I N _ L I S T F E A T U R E S )
)
message ( WARNING "Feture 'threadsafe' and other features are mutually exclusive, enable feature ALLOW_UNSUPPORTED automatically to enable them both." )
set ( ALLOW_UNSUPPORTED ON )
2018-02-01 22:48:40 +08:00
endif ( )
2024-06-03 12:59:19 +08:00
if ( "fortran" IN_LIST FEATURES )
message ( WARNING "Feature 'fortran' is not yet officially supported within VCPKG. Build will most likly fail if ninja 1.10 and a Fortran compiler are not available." )
2020-03-29 09:41:08 +08:00
endif ( )
2020-01-11 02:44:44 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-06-10 06:17:07 +08:00
F E A T U R E S
p a r a l l e l H D F 5 _ E N A B L E _ P A R A L L E L
t o o l s H D F 5 _ B U I L D _ T O O L S
2023-02-23 04:38:45 +08:00
t o o l s H D F 5 _ B U I L D _ H L _ G I F _ T O O L S
2021-06-10 06:17:07 +08:00
c p p H D F 5 _ B U I L D _ C P P _ L I B
s z i p H D F 5 _ E N A B L E _ S Z I P _ S U P P O R T
s z i p H D F 5 _ E N A B L E _ S Z I P _ E N C O D I N G
z l i b H D F 5 _ E N A B L E _ Z _ L I B _ S U P P O R T
f o r t r a n H D F 5 _ B U I L D _ F O R T R A N
t h r e a d s a f e H D F 5 _ E N A B L E _ T H R E A D S A F E
2021-10-27 13:38:05 +08:00
u t i l s H D F 5 _ B U I L D _ U T I L S
2023-02-23 04:38:45 +08:00
m a p H D F 5 _ E N A B L E _ M A P _ A P I
2020-01-11 02:44:44 +08:00
)
2022-06-07 03:37:54 +08:00
if ( "tools" IN_LIST FEATURES AND VCPKG_CRT_LINKAGE STREQUAL "static" )
2020-03-29 09:41:08 +08:00
list ( APPEND FEATURE_OPTIONS -DBUILD_STATIC_EXECS=ON )
endif ( )
2020-06-24 03:58:50 +08:00
if ( NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
list ( APPEND FEATURE_OPTIONS
- D B U I L D _ S T A T I C _ L I B S = O F F
- D O N L Y _ S H A R E D _ L I B S = O N )
endif ( )
2021-06-10 06:17:07 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2019-04-03 11:35:44 +08:00
D I S A B L E _ P A R A L L E L _ C O N F I G U R E
2020-01-11 02:44:44 +08:00
O P T I O N S
$ { F E A T U R E _ O P T I O N S }
2017-01-11 19:18:49 +08:00
- D B U I L D _ T E S T I N G = O F F
- D H D F 5 _ B U I L D _ E X A M P L E S = O F F
- D H D F 5 _ I N S T A L L _ D A T A _ D I R = s h a r e / h d f 5 / d a t a
2022-06-07 03:37:54 +08:00
- D H D F 5 _ I N S T A L L _ C M A K E _ D I R = s h a r e / h d f 5
2020-06-24 03:58:50 +08:00
- D H D F _ P A C K A G E _ N A M E S P A C E : S T R I N G = h d f 5 : :
2021-10-27 13:38:05 +08:00
- D H D F 5 _ M S V C _ N A M I N G _ C O N V E N T I O N = O F F
- D A L L O W _ U N S U P P O R T E D = $ { A L L O W _ U N S U P P O R T E D }
2023-10-04 11:38:06 +08:00
- D 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 a e c = O N
2021-10-27 13:38:05 +08:00
O P T I O N S _ R E L E A S E
- D C M A K E _ D E B U G _ P O S T F I X = # For lib name in pkgconfig files
2017-01-11 19:18:49 +08:00
)
2021-06-10 06:17:07 +08:00
vcpkg_cmake_install ( )
2017-01-11 19:18:49 +08:00
vcpkg_copy_pdbs ( )
2021-06-10 06:17:07 +08:00
vcpkg_cmake_config_fixup ( )
2021-05-07 04:52:01 +08:00
set ( debug_suffix debug )
if ( VCPKG_TARGET_IS_WINDOWS )
set ( debug_suffix D )
endif ( )
2021-10-27 13:38:05 +08:00
2021-05-07 04:52:01 +08:00
vcpkg_fixup_pkgconfig ( )
2022-06-16 05:09:36 +08:00
file ( GLOB pc_files "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/*.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc" )
foreach ( file IN LISTS pc_files )
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2022-01-04 05:08:39 +08:00
vcpkg_replace_string ( "${file}" " -lhdf5" " -llibhdf5" )
2022-06-16 05:09:36 +08:00
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS )
vcpkg_replace_string ( "${file}" "/msmpi.lib\" " " /msmpi\ "" )
endif ( )
endforeach ( )
2019-04-03 20:52:27 +08:00
2020-03-29 09:41:08 +08:00
file ( READ "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" contents )
2021-10-27 13:38:05 +08:00
string ( REPLACE [[ ${ HDF5_PACKAGE_NAME } _TOOLS_DIR "${PACKAGE_PREFIX_DIR}/bin" ]]
[ [ $ { H D F 5 _ P A C K A G E _ N A M E } _ T O O L S _ D I R " $ { P A C K A G E _ P R E F I X _ D I R } / t o o l s / h d f 5 " ] ]
c o n t e n t s $ { c o n t e n t s }
)
2020-03-29 09:41:08 +08:00
file ( WRITE "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" ${ contents } )
2020-01-11 02:44:44 +08:00
2022-10-22 06:33:12 +08:00
set ( HDF5_TOOLS "" )
2022-06-07 03:37:54 +08:00
if ( "tools" IN_LIST FEATURES )
2022-10-22 06:33:12 +08:00
list ( APPEND HDF5_TOOLS h5copy h5diff h5dump h5ls h5stat gif2h5 h52gif h5clear h5debug
2023-02-23 04:38:45 +08:00
h 5 f o r m a t _ c o n v e r t h 5 j a m h 5 u n j a m h 5 m k g r p h 5 r e p a c k h 5 r e p a r t h 5 w a t c h h 5 i m p o r t h 5 d e l e t e
2024-06-03 12:59:19 +08:00
h 5 p e r f _ s e r i a l
2021-10-27 13:38:05 +08:00
)
2022-01-26 02:31:15 +08:00
2022-10-22 06:33:12 +08:00
if ( "parallel" IN_LIST FEATURES )
list ( APPEND HDF5_TOOLS ph5diff )
endif ( )
2022-01-26 02:31:15 +08:00
2022-10-22 06:33:12 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
2022-11-10 02:39:35 +08:00
list ( APPEND HDF5_TOOLS h5cc h5hlcc )
if ( "cpp" IN_LIST FEATURES )
list ( APPEND HDF5_TOOLS h5c++ h5hlc++ )
endif ( )
2022-10-22 06:33:12 +08:00
endif ( )
2022-01-26 02:31:15 +08:00
2022-06-07 03:37:54 +08:00
if ( "parallel" IN_LIST FEATURES )
2022-10-22 06:33:12 +08:00
list ( APPEND HDF5_TOOLS h5perf )
if ( NOT VCPKG_TARGET_IS_WINDOWS )
list ( APPEND HDF5_TOOLS h5pcc )
endif ( )
2022-06-07 03:37:54 +08:00
endif ( )
2021-10-27 13:38:05 +08:00
endif ( )
if ( "utils" IN_LIST FEATURES )
2022-10-22 06:33:12 +08:00
list ( APPEND HDF5_TOOLS mirror_server mirror_server_stop )
endif ( )
if ( HDF5_TOOLS )
vcpkg_copy_tools ( TOOL_NAMES ${ HDF5_TOOLS } AUTO_CLEAN )
2023-01-09 17:07:46 +08:00
foreach ( tool h5cc h5pcc h5hlcc )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${tool}" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${tool}" "${CURRENT_INSTALLED_DIR}" "$(dirname \" $ 0\ ")/../.." )
endif ( )
endforeach ( )
2023-02-23 04:38:45 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin/h5fuse.sh" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/h5fuse.sh" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/h5fuse.sh" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/h5fuse.sh" )
endif ( )
2020-03-29 09:41:08 +08:00
endif ( )
2021-10-27 13:38:05 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2021-05-07 04:52:01 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2020-03-29 09:41:08 +08:00
endif ( )
2020-01-11 02:44:44 +08:00
2021-10-27 13:38:05 +08:00
# Clean up
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2021-05-07 04:52:01 +08:00
configure_file ( "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY )
2023-04-05 03:10:32 +08:00
if ( "parallel" IN_LIST FEATURES )
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
endif ( )
2021-10-27 13:38:05 +08:00
2023-01-20 09:55:56 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/H5public.h" "#define H5public_H" "#define H5public_H\n#ifndef H5_BUILT_AS_DYNAMIC_LIB\n#define H5_BUILT_AS_DYNAMIC_LIB\n#endif\n" )
endif ( )
2023-10-04 11:38:06 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" )