2023-10-03 07:36:17 +08:00
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
|
|
|
message("Note: `mp-units` requires Clang16+ or GCC11+")
|
|
|
|
endif()
|
|
|
|
|
2020-09-10 03:10:56 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mpusz/units
|
2023-06-22 13:41:20 +08:00
|
|
|
REF "v${VERSION}"
|
2023-10-03 07:36:17 +08:00
|
|
|
SHA512 994922a391ed5c1d0e023545beeb0bbeb8ec067be408f715d553e509d9106cdb5b27cfbaa69f0ca1a27cdf9532edacaff7d2cabaafd54b1713f9c8add93bc389
|
2020-09-10 03:10:56 +08:00
|
|
|
PATCHES
|
2023-06-22 13:41:20 +08:00
|
|
|
config.patch
|
2020-09-10 03:10:56 +08:00
|
|
|
)
|
|
|
|
|
2023-06-22 13:41:20 +08:00
|
|
|
set(USE_LIBFMT OFF)
|
|
|
|
if ("use-libfmt" IN_LIST FEATURES)
|
|
|
|
set(USE_LIBFMT ON)
|
|
|
|
endif()
|
|
|
|
|
2021-11-16 06:18:12 +08:00
|
|
|
vcpkg_cmake_configure(
|
2022-08-03 14:17:02 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}/src"
|
2023-06-22 13:41:20 +08:00
|
|
|
OPTIONS
|
2023-10-03 07:36:17 +08:00
|
|
|
-DMP_UNITS_USE_LIBFMT=${USE_LIBFMT}
|
2020-09-10 03:10:56 +08:00
|
|
|
)
|
|
|
|
|
2021-11-16 06:18:12 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
|
2020-09-10 03:10:56 +08:00
|
|
|
|
|
|
|
# Handle copyright/readme/package files
|
2023-06-22 13:41:20 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|
2021-11-16 06:18:12 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2020-09-10 03:10:56 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug"
|
2023-06-22 13:41:20 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/lib") # Header only
|