2020-08-11 07:08:37 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HDF5_USE_STATIC_LIBRARIES)
|
2019-05-03 13:57:43 +08:00
|
|
|
|
2020-08-11 07:08:37 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
2019-05-03 13:57:43 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Unidata/netcdf-cxx4
|
2019-11-05 18:24:18 +08:00
|
|
|
REF f8882188267488ef801691e69ad072e3eb217ad8 # v4.3.1
|
|
|
|
SHA512 9816acf221d196e21af19d4c3d85484934916e7c018e9b2c96aab9f5660b2f08c5db9cd8254ba3fa5f0aa5f5c5ad7bd3a3aaba559e5e640c5349d44e07a20ed3
|
2019-05-03 13:57:43 +08:00
|
|
|
HEAD_REF master
|
2020-11-11 01:37:13 +08:00
|
|
|
PATCHES
|
|
|
|
fix-dependecy-hdf5.patch
|
|
|
|
export-cmake-targets.patch
|
2017-02-28 19:23:20 +08:00
|
|
|
)
|
|
|
|
|
2020-11-11 01:37:13 +08:00
|
|
|
#Provided by upstream https://github.com/Unidata/netcdf-cxx4/blob/master/netCDFCxxConfig.cmake.in
|
2023-03-02 02:39:14 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/netCDFCxxConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
|
2020-11-11 01:37:13 +08:00
|
|
|
|
2023-03-02 02:39:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-02-28 19:23:20 +08:00
|
|
|
OPTIONS
|
|
|
|
-DNCXX_ENABLE_TESTS=OFF
|
|
|
|
-DCMAKE_INSTALL_CMAKECONFIGDIR=share/netCDFCxx
|
2019-03-15 05:33:56 +08:00
|
|
|
-DHDF5_USE_STATIC_LIBRARIES=${HDF5_USE_STATIC_LIBRARIES}
|
2017-02-28 19:23:20 +08:00
|
|
|
# OPTIONS_RELEASE -DOPTIMIZE=1
|
|
|
|
# OPTIONS_DEBUG -DDEBUGGABLE=1
|
|
|
|
)
|
|
|
|
|
2023-03-02 02:39:14 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/netCDFCxx PACKAGE_NAME netCDFCxx)
|
2019-11-05 18:24:18 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-02-28 19:23:20 +08:00
|
|
|
|
2023-03-02 02:39:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-02-28 19:23:20 +08:00
|
|
|
|
2019-11-05 18:24:18 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2023-03-02 02:39:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2019-11-05 18:24:18 +08:00
|
|
|
endif()
|
|
|
|
|
2017-02-28 19:23:20 +08:00
|
|
|
# Handle copyright
|
2023-03-02 02:39:14 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|