vcpkg/ports/mp-units/portfile.cmake

35 lines
981 B
CMake
Raw Normal View History

2023-10-03 07:36:17 +08:00
if(VCPKG_TARGET_IS_LINUX)
message("Note: `mp-units` requires Clang16+ or GCC11+")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mpusz/units
REF "v${VERSION}"
2024-06-27 11:20:16 +08:00
SHA512 7968b215c6b27a7a988ce41235139a57be6bb849db6d6ea0df46b0a40d279d4be4c53646c5a4bf695fb9e70ff4967d3fd443fec8ee40c4ab7f0c90d8695632c3
PATCHES
config.patch
)
2024-06-27 11:20:16 +08:00
set(USE_STD_FORMAT TRUE)
if ("use-libfmt" IN_LIST FEATURES)
2024-06-27 11:20:16 +08:00
set(USE_STD_FORMAT FALSE)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/src"
OPTIONS
2024-06-27 11:20:16 +08:00
-DMP_UNITS_API_STD_FORMAT=${USE_STD_FORMAT}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
# Handle copyright/readme/package files
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
file(INSTALL "${SOURCE_PATH}/README.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug"
"${CURRENT_PACKAGES_DIR}/lib") # Header only