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-09-18 02:39:29 +08:00
|
|
|
REF 44344000f0fa32e66787d6d2c9ff5ddfd3605df7
|
|
|
|
SHA512 1ec75a4b6310f735261c996c63df8176f0523d8f59a23edd49fd8efbdcbf1e78051ba2f36df0920f6f5e6bbc8f81ea4639f73e05bb1cb7f97a8e500bde667782
|
2017-09-01 07:06:18 +08:00
|
|
|
HEAD_REF master
|
2019-09-18 02:39:29 +08:00
|
|
|
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp.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
|
|
|
|
-DUSE_SYSTEM_TZ_DB=${DATE_USE_SYSTEM_TZ_DB}
|
|
|
|
-DENABLE_DATE_TESTING=OFF
|
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)
|
|
|
|
|
|
|
|
# Remove the wrapper when backwards compatibility with the unofficial::date::date and unofficial::date::tz
|
|
|
|
# targets is no longer required.
|
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date)
|