mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 17:41:09 +08:00
[date] Fix config.cmake and usage (#12739)
* [date] Fix config.cmake and usage * Correct fix * Remove wrapper and usage
This commit is contained in:
parent
5b35ffe65b
commit
6718a4a703
15
ports/date/0003-find-dependency-pthread.patch
Normal file
15
ports/date/0003-find-dependency-pthread.patch
Normal 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( )
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -1,4 +0,0 @@
|
||||
The package date provides CMake targets:
|
||||
|
||||
find_package(date CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE date::date date::tz)
|
@ -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()
|
Loading…
x
Reference in New Issue
Block a user