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}"
|
2024-06-27 11:20:16 +08:00
|
|
|
SHA512 7968b215c6b27a7a988ce41235139a57be6bb849db6d6ea0df46b0a40d279d4be4c53646c5a4bf695fb9e70ff4967d3fd443fec8ee40c4ab7f0c90d8695632c3
|
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
|
|
|
)
|
|
|
|
|
2024-06-27 11:20:16 +08:00
|
|
|
set(USE_STD_FORMAT TRUE)
|
2023-06-22 13:41:20 +08:00
|
|
|
if ("use-libfmt" IN_LIST FEATURES)
|
2024-06-27 11:20:16 +08:00
|
|
|
set(USE_STD_FORMAT FALSE)
|
2023-06-22 13:41:20 +08:00
|
|
|
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
|
2024-06-27 11:20:16 +08:00
|
|
|
-DMP_UNITS_API_STD_FORMAT=${USE_STD_FORMAT}
|
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
|