2017-08-16 03:47:23 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2018-04-10 20:46:46 +08:00
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
message(WARNING
|
2019-05-18 02:13:22 +08:00
|
|
|
"You will need to also install https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml into your install location.\n"
|
2018-04-10 20:46:46 +08:00
|
|
|
"See https://howardhinnant.github.io/date/tz.html"
|
|
|
|
)
|
|
|
|
endif()
|
2017-09-01 07:06:18 +08:00
|
|
|
|
2017-08-16 03:47:23 +08:00
|
|
|
vcpkg_from_github(
|
2017-09-01 07:06:18 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO HowardHinnant/date
|
2019-11-14 14:14:00 +08:00
|
|
|
REF 3e376be2e9b4d32c946bd83c22601e4b7a1ce421
|
|
|
|
SHA512 9dad181f8544bfcff8c42200552b6673e537c53b34fbad11663d6435d4e5fd5a3ac6cabbb76312481c9784b237151d9ccd161bb1b8c54c563fa75073896f3cff
|
2017-09-01 07:06:18 +08:00
|
|
|
HEAD_REF master
|
2019-11-14 14:14:00 +08:00
|
|
|
PATCHES
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp.patch"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/0002-fix-cmake-3.14.patch"
|
2017-08-16 03:47:23 +08:00
|
|
|
)
|
|
|
|
|
2019-09-18 02:39:29 +08:00
|
|
|
set(DATE_USE_SYSTEM_TZ_DB 1)
|
2018-04-10 20:46:46 +08:00
|
|
|
if("remote-api" IN_LIST FEATURES)
|
2019-09-18 02:39:29 +08:00
|
|
|
set(DATE_USE_SYSTEM_TZ_DB 0)
|
2018-04-10 20:46:46 +08:00
|
|
|
endif()
|
|
|
|
|
2017-08-16 03:47:23 +08:00
|
|
|
vcpkg_configure_cmake(
|
2017-09-01 07:06:18 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
2019-09-18 02:39:29 +08:00
|
|
|
OPTIONS
|
2019-11-14 14:14:00 +08:00
|
|
|
-DBUILD_TZ_LIB=ON
|
2019-09-18 02:39:29 +08:00
|
|
|
-DUSE_SYSTEM_TZ_DB=${DATE_USE_SYSTEM_TZ_DB}
|
2017-08-16 03:47:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2019-09-18 02:39:29 +08:00
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake TARGET_PATH share/date)
|
|
|
|
else()
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/date TARGET_PATH share/date)
|
|
|
|
endif()
|
2018-04-10 20:46:46 +08:00
|
|
|
|
2017-09-01 07:06:18 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-08-16 03:47:23 +08:00
|
|
|
|
2019-09-18 02:39:29 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-09-01 07:06:18 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright)
|
2019-09-18 02:39:29 +08:00
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/date)
|
|
|
|
|
2019-11-14 14:14:00 +08:00
|
|
|
# Remove the wrapper when backwards compatibility when the unofficial::date::date and unofficial::date::tz
|
|
|
|
# targets are no longer required.
|
2019-09-18 02:39:29 +08:00
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date)
|