vcpkg/ports/hdf5/portfile.cmake

164 lines
5.6 KiB
CMake
Raw Normal View History

2020-09-05 22:19:43 +08:00
# highfive should be updated together with hdf5
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO HDFGroup/hdf5
REF hdf5-1_12_2
SHA512 8f110e035a9bd5b07687b30fb944ed72e5b6a6e0ea74ee650250f40f0d4ff81e304366a76129a50a2d37c7f4c59a57356d0d9eed18db6cb90e924c62273d17a4
HEAD_REF develop
PATCHES
hdf5_config.patch
szip.patch
pkgconfig-requires.patch
pkgconfig-link-order.patch
)
set(ALLOW_UNSUPPORTED OFF)
if ("parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES)
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
("parallel" IN_LIST FEATURES
OR "fortran" IN_LIST FEATURES
OR "cpp" IN_LIST FEATURES)
)
message(WARNING "Feture 'threadsafe' and other features are mutually exclusive, enable feature ALLOW_UNSUPPORTED automatically to enable them both.")
set(ALLOW_UNSUPPORTED ON)
endif()
if ("fortran" IN_LIST FEATURE)
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.")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
parallel HDF5_ENABLE_PARALLEL
tools HDF5_BUILD_TOOLS
cpp HDF5_BUILD_CPP_LIB
szip HDF5_ENABLE_SZIP_SUPPORT
szip HDF5_ENABLE_SZIP_ENCODING
zlib HDF5_ENABLE_Z_LIB_SUPPORT
fortran HDF5_BUILD_FORTRAN
threadsafe HDF5_ENABLE_THREADSAFE
utils HDF5_BUILD_UTILS
)
file(REMOVE "${SOURCE_PATH}/config/cmake_ext_mod/FindSZIP.cmake")#Outdated; does not find debug szip
if("tools" IN_LIST FEATURES AND VCPKG_CRT_LINKAGE STREQUAL "static")
list(APPEND FEATURE_OPTIONS -DBUILD_STATIC_EXECS=ON)
endif()
if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND FEATURE_OPTIONS
-DBUILD_STATIC_LIBS=OFF
-DONLY_SHARED_LIBS=ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${FEATURE_OPTIONS}
2017-01-11 19:18:49 +08:00
-DBUILD_TESTING=OFF
-DHDF5_BUILD_EXAMPLES=OFF
-DHDF5_INSTALL_DATA_DIR=share/hdf5/data
-DHDF5_INSTALL_CMAKE_DIR=share/hdf5
-DHDF_PACKAGE_NAMESPACE:STRING=hdf5::
-DHDF5_MSVC_NAMING_CONVENTION=OFF
-DSZIP_USE_EXTERNAL=ON
-DALLOW_UNSUPPORTED=${ALLOW_UNSUPPORTED}
OPTIONS_RELEASE
-DCMAKE_DEBUG_POSTFIX= # For lib name in pkgconfig files
2017-01-11 19:18:49 +08:00
)
vcpkg_cmake_install()
2017-01-11 19:18:49 +08:00
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
set(debug_suffix debug)
if(VCPKG_TARGET_IS_WINDOWS)
set(debug_suffix D)
endif()
vcpkg_fixup_pkgconfig()
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")
vcpkg_replace_string("${file}" " -lhdf5" " -llibhdf5")
endif()
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string("${file}" "/msmpi.lib\"" "/msmpi\"")
endif()
endforeach()
file(READ "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" contents)
string(REPLACE [[${HDF5_PACKAGE_NAME}_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/bin"]]
[[${HDF5_PACKAGE_NAME}_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/tools/hdf5"]]
contents ${contents}
)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" ${contents})
set(HDF5_TOOLS "")
if("tools" IN_LIST FEATURES)
list(APPEND HDF5_TOOLS h5copy h5diff h5dump h5ls h5stat gif2h5 h52gif h5clear h5debug
h5format_convert h5jam h5unjam h5mkgrp h5repack h5repart h5watch h5import
)
if("parallel" IN_LIST FEATURES)
list(APPEND HDF5_TOOLS ph5diff)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
list(TRANSFORM HDF5_TOOLS REPLACE "^(.+)$" "\\1-shared")
endif()
if(NOT VCPKG_TARGET_IS_WINDOWS)
list(APPEND HDF5_TOOLS h5cc h5hlcc)
if("cpp" IN_LIST FEATURES)
list(APPEND HDF5_TOOLS h5c++ h5hlc++)
endif()
endif()
if("parallel" IN_LIST FEATURES)
list(APPEND HDF5_TOOLS h5perf )
if(NOT VCPKG_TARGET_IS_WINDOWS)
list(APPEND HDF5_TOOLS h5pcc)
endif()
else()
list(APPEND HDF5_TOOLS h5perf_serial)
endif()
endif()
if ("utils" IN_LIST FEATURES)
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()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
# Clean up
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright")
[seacas/vtkm/vtk/paraview] Add/update ports. (#27928) * [cgns] update to 4.2.0 * [vtk-m] update to 1.6.0 * [vtk] Update to 9.0.1-pv5.9.1 - VTK update to match release version of ParaView * [ParaView] Update to 5.9.1 * version stuff * fix automatic svg linkage in static builds * update qt5-svg * revisit vtk - fix build with vtk-m 1.6 - remove unused patches - remove comments * bump version * remove two commented lines * version stuff * remove old PR version * commit stuff * commit stuff * update notes * wip commit * update paraview * fix hdf5 patch * fix patch * fix patch * fix portfile * add mpi feature * format manifest * use relativ path * trace * retry * move qml files again * try with host triplet * - use VCPKG_CRT_LINKAGE - use METIS not metis * fix casing Zlib * hopefully more fixes on other platforms. * fix patch * fix missing ws * fix typos * scale down to warning * revert jsoncpp change fix zoltan on osx? * move trace option to failing port * move trace option to failing port * Revert "trilinos vcpkg.json changes" * verdict fix osx build ? * fix patch * fix internal find_package call * also apply correct case for metis * disable METIS on osx * vtk-m don't support arm. * force more features in Ci * fix missing , * more fixes * more vtk python try and error. * - paraview python setup same as vtk - remove openvr from platforms not supporting it - trace openimageio * fix case and remove fmt for openimageio. * trying to fix stuff * set hash to 0 * [skip actions] add missing module * WebCore module moved to paraview&python * fixes * remove patch in vtk-dicom * add var to maybe unused * use correct 5.11 ref instead of the one in release * Patch cleanup round 1 * remove empty patch parts * fix vtkm configs * reintegrate jsoncpp.patch * fix patch * add single seacas/kokkos/zoltan ports * throw out trilinos, zoltan, kokkos replace trilinos with seacas make seacas work for dynamic windows * fix mpi feature * fix dependency * retry dep fix * rename target * remove double line * fix target * fix patch * retry * remove cgns config * fix cgns * no seacas trace * lowercase hdf5 target * fix case of metis * disable Fortran * add iotr patch * add additional config folder * handel case sensitive Seacas again * get trace again and force jsoncpp * update cmake to 3.25.0 * bump port-version * add patch from vtk upstream * cleanup, format-manifest * fix port version * v db * opencv4 always inject deps. * fix test port to not require stuff which is not supported on x86 * Fix HDF5 lookup in opencv4 * only delete bin folder in static builds * add license field * v db * add missing " * v db * trace again * fix rtabmap python dep * fix openimageio by deleting the find module * v db * cr cleanup * v db * opencv4 v db due to merge with master. Had to bump port version * v db * v db * v db * CR comments * v db for cr comments * trace theia output * revert theia trace * v db * try without patch * revert rtabmap changes * v db after merge * v db for all
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()