diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/date | |
Diffstat (limited to 'vcpkg/ports/date')
| -rw-r--r-- | vcpkg/ports/date/portfile.cmake | 41 | ||||
| -rw-r--r-- | vcpkg/ports/date/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/date/vcpkg.json | 26 |
3 files changed, 71 insertions, 0 deletions
diff --git a/vcpkg/ports/date/portfile.cmake b/vcpkg/ports/date/portfile.cmake new file mode 100644 index 0000000..05badd0 --- /dev/null +++ b/vcpkg/ports/date/portfile.cmake @@ -0,0 +1,41 @@ +if(VCPKG_TARGET_IS_WINDOWS) + message(WARNING + "You will need to also install https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml into your install location.\n" + "See https://howardhinnant.github.io/date/tz.html" + ) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO HowardHinnant/date + REF "v${VERSION}" + SHA512 9bffca5c7cfd1769f66bef330fe4ef0ad2512a8afd229ddb4043a4f166741e697c7a5fbdddf29f7157b3fc2c2c2a80fa7cff45078f1d8ab248d3b07e14518fcf + HEAD_REF master +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + remote-api USE_SYSTEM_TZ_DB +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DBUILD_TZ_LIB=ON +) + +vcpkg_cmake_install() + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_cmake_config_fixup(CONFIG_PATH CMake) +else() + vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/date") +endif() + +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/vcpkg/ports/date/usage b/vcpkg/ports/date/usage new file mode 100644 index 0000000..41d8671 --- /dev/null +++ b/vcpkg/ports/date/usage @@ -0,0 +1,4 @@ +date provides CMake targets: + + find_package(date CONFIG REQUIRED) + target_link_libraries(main PRIVATE date::date date::date-tz) diff --git a/vcpkg/ports/date/vcpkg.json b/vcpkg/ports/date/vcpkg.json new file mode 100644 index 0000000..8ea98c3 --- /dev/null +++ b/vcpkg/ports/date/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "date", + "version": "3.0.4", + "description": "A date and time library based on the C++17 <chrono> header", + "homepage": "https://github.com/HowardHinnant/date", + "license": "MIT", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "remote-api": { + "description": "support automatic download of tz data", + "supports": "!uwp & !android", + "dependencies": [ + "curl" + ] + } + } +} |