2020-09-05 22:19:43 +08:00
# highfive should be updated together with hdf5
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
2022-06-07 03:37:54 +08:00
R E F h d f 5 - 1 _ 1 2 _ 2
S H A 5 1 2 8 f 1 1 0 e 0 3 5 a 9 b d 5 b 0 7 6 8 7 b 3 0 f b 9 4 4 e d 7 2 e 5 b 6 a 6 e 0 e a 7 4 e e 6 5 0 2 5 0 f 4 0 f 0 d 4 f f 8 1 e 3 0 4 3 6 6 a 7 6 1 2 9 a 5 0 a 2 d 3 7 c 7 f 4 c 5 9 a 5 7 3 5 6 d 0 d 9 e e d 1 8 d b 6 c b 9 0 e 9 2 4 c 6 2 2 7 3 d 1 7 a 4
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
p k g c o n f i g - r e q u i r e s . p a t c h
2021-07-07 04:34:41 +08:00
p k g c o n f i g - l i n k - o r d e r . 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 )
2021-10-27 13:38:05 +08:00
message ( WARNING "Feature 'Parallel' and 'cpp' are mutually exclusive, enable feature ALLOW_UNSUPPORTED automatically to enable them both." )
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 ( )
2020-03-29 09:41:08 +08:00
if ( "fortran" IN_LIST FEATURE )
2021-10-27 13:38:05 +08:00
message ( WARNING "Feature 'fortran' is not yet official 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
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
2020-01-11 02:44:44 +08:00
)
2021-05-07 04:52:01 +08:00
file ( REMOVE "${SOURCE_PATH}/config/cmake_ext_mod/FindSZIP.cmake" ) #Outdated; does not find debug szip
2020-03-29 09:41:08 +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 S Z I P _ U S E _ E X T E R N A L = O N
- 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 }
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
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
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 ( )
2020-03-29 09:41:08 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
2021-10-27 13:38:05 +08:00
list ( TRANSFORM HDF5_TOOLS REPLACE "^(.+)$" "\\1-shared" )
2020-03-29 09:41:08 +08:00
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
else ( )
list ( APPEND HDF5_TOOLS h5perf_serial )
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 ( )
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 )
2021-10-27 13:38:05 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" )
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 ( )