[date] Fix config.cmake and usage (#12739)

* [date] Fix config.cmake and usage

* Correct fix

* Remove wrapper and usage
This commit is contained in:
Jack·Boos·Yu 2020-08-07 11:44:42 -07:00 committed by GitHub
parent 5b35ffe65b
commit 6718a4a703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 20 deletions

View File

@ -0,0 +1,15 @@
diff --git a/cmake/dateConfig.cmake b/cmake/dateConfig.cmake
index 20f86e8..2198ad1 100644
--- a/cmake/dateConfig.cmake
+++ b/cmake/dateConfig.cmake
@@ -1,8 +1,8 @@
include( CMakeFindDependencyMacro )
include( "${CMAKE_CURRENT_LIST_DIR}/dateTargets.cmake" )
-if( NOT MSVC AND TARGET date::tz )
+if( NOT MSVC AND TARGET date::date-tz )
find_dependency( Threads REQUIRED)
- get_target_property( _tzill date::tz INTERFACE_LINK_LIBRARIES )
+ get_target_property( _tzill date::date-tz INTERFACE_LINK_LIBRARIES )
if( _tzill AND "${_tzill}" MATCHES "libcurl" )
find_dependency( CURL )
endif( )

View File

@ -1,5 +1,6 @@
Source: date
Version: 3.0.0
Port-Version: 1
Homepage: https://github.com/HowardHinnant/date
Description: A date and time library based on the C++17 <chrono> header

View File

@ -14,6 +14,7 @@ vcpkg_from_github(
PATCHES
0001-fix-uwp.patch
0002-fix-cmake-3.14.patch
0003-find-dependency-pthread.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
INVERTED_FEATURES
@ -39,9 +40,5 @@ endif()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/date)
# Remove the wrapper when backwards compatibility when the unofficial::date::date and unofficial::date::tz
# targets are no longer required.
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/date)
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright)

View File

@ -1,4 +0,0 @@
The package date provides CMake targets:
find_package(date CONFIG REQUIRED)
target_link_libraries(main PRIVATE date::date date::tz)

View File

@ -1,11 +0,0 @@
_find_package(${ARGS})
if(NOT TARGET unofficial::date::date AND TARGET date::date)
add_library(unofficial::date::date INTERFACE IMPORTED)
target_link_libraries(unofficial::date::date INTERFACE date::date)
endif()
if(NOT TARGET unofficial::date::tz AND TARGET date::tz)
add_library(unofficial::date::tz INTERFACE IMPORTED)
target_link_libraries(unofficial::date::tz INTERFACE date::tz)
endif()