From 600f7fdf30434f7c1e1e15acf3df3271d6b91387 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 10 Apr 2018 05:46:46 -0700 Subject: [date] Fix Linux&OSX, add unofficial targets --- ports/date/CMakeLists.txt | 22 +++++++++++++++++++--- ports/date/CONTROL | 4 ++++ ports/date/portfile.cmake | 19 +++++++++++++++---- 3 files changed, 38 insertions(+), 7 deletions(-) (limited to 'ports/date') diff --git a/ports/date/CMakeLists.txt b/ports/date/CMakeLists.txt index 4c38e4a87..292c1758a 100644 --- a/ports/date/CMakeLists.txt +++ b/ports/date/CMakeLists.txt @@ -1,28 +1,44 @@ cmake_minimum_required(VERSION 3.5.1) project(tz CXX) +set(CMAKE_CXX_STANDARD 11) if(MSVC) add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) endif() -add_definitions(-DNOMINMAX) +option(HAS_REMOTE_API "" 0) +add_definitions(-DNOMINMAX -DHAS_REMOTE_API=${HAS_REMOTE_API}) -include_directories("./include") +add_library(date INTERFACE) +target_include_directories(date INTERFACE $) add_library(tz src/tz.cpp) +target_include_directories(tz PUBLIC $ $) + +if(HAS_REMOTE_API) + find_package(CURL REQUIRED) + target_link_libraries(tz PUBLIC $) + target_include_directories(tz PUBLIC $) +endif() if(BUILD_SHARED_LIBS) target_compile_definitions(tz PRIVATE -DDATE_BUILD_DLL) endif() install( - TARGETS tz + TARGETS tz date + EXPORT tz RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-date-config.cmake" "include(\${CMAKE_CURRENT_LIST_DIR}/unofficial-date-targets.cmake)\n") + +install(EXPORT tz FILE unofficial-date-targets.cmake NAMESPACE unofficial::date:: DESTINATION share/unofficial-date) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-date-config.cmake DESTINATION share/unofficial-date) + if(NOT DISABLE_INSTALL_HEADERS) install(FILES include/date/date.h include/date/tz.h include/date/julian.h include/date/iso_week.h include/date/islamic.h DESTINATION include/date) endif() diff --git a/ports/date/CONTROL b/ports/date/CONTROL index 8c1797072..bf3095ac6 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,3 +1,7 @@ Source: date Version: 2.4 Description: A date and time library based on the C++11/14/17 header + +Feature: remote-api +Description: support automatic download of tz data +Build-Depends: curl diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index c60a7bcb0..3b36a19fc 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -1,9 +1,11 @@ include(vcpkg_common_functions) -message(WARNING - "You will need to also install http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml into your install location" - "See https://howardhinnant.github.io/date/tz.html" -) +if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + message(WARNING + "You will need to also install http://unicode.org/repos/cldr/trunk/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 @@ -20,18 +22,27 @@ vcpkg_apply_patches( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +set(HAS_REMOTE_API 0) +if("remote-api" IN_LIST FEATURES) + set(HAS_REMOTE_API 1) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS -DHAS_REMOTE_API=${HAS_REMOTE_API} OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-date TARGET_PATH share/unofficial-date) + vcpkg_copy_pdbs() set(HEADER "${CURRENT_PACKAGES_DIR}/include/date/tz.h") file(READ "${HEADER}" _contents) +string(REPLACE "#define TZ_H" "#define TZ_H\n#undef HAS_REMOTE_API\n#define HAS_REMOTE_API ${HAS_REMOTE_API}" _contents "${_contents}") if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) string(REPLACE "ifdef DATE_BUILD_DLL" "if 1" _contents "${_contents}") endif() -- cgit v1.2.3 From 0764aafbd07fffa81e68aa1fe091b01ea429e29c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Apr 2018 04:03:17 -0700 Subject: [abseil][aws-sdk-cpp][breakpad][chakracore][cimg][date][exiv2][libzip][rs-core-lib] Upgrades --- ports/date/CONTROL | 2 +- ports/date/portfile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ports/date') diff --git a/ports/date/CONTROL b/ports/date/CONTROL index bf3095ac6..f9a86d671 100644 --- a/ports/date/CONTROL +++ b/ports/date/CONTROL @@ -1,5 +1,5 @@ Source: date -Version: 2.4 +Version: 2.4.1 Description: A date and time library based on the C++11/14/17 header Feature: remote-api diff --git a/ports/date/portfile.cmake b/ports/date/portfile.cmake index 3b36a19fc..749c0c5f0 100644 --- a/ports/date/portfile.cmake +++ b/ports/date/portfile.cmake @@ -10,8 +10,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO HowardHinnant/date - REF v2.4 - SHA512 01bcc021ebf9ca0ac88c797896a291ff81834e7fae37323ad20881d3a172963c04d3c7bea0dd37cd945b756ab7f70f0a02edb18a085bf9abf8d8f10056f73f3c + REF v2.4.1 + SHA512 ce7d1c4518558d3690b3a33cd3da1066b43a5f641282c331c60be73e9b010227d4998bca5f34694215ae52f6514a2f5eccd6b0a5ee3dcf8cef2f2d1644c8beee HEAD_REF master ) -- cgit v1.2.3