Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[date] Fix installation #32772

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions ports/date/0002-fix-cmake-3.14.patch

This file was deleted.

63 changes: 63 additions & 0 deletions ports/date/0002-fix-cmake-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 012512a..2cbcc21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,10 +73,6 @@ target_sources( date INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/iso_week.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/julian.h>
)
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
- # public headers will get installed:
- set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h )
-endif ()

# These used to be set with generator expressions,
#
@@ -144,7 +140,6 @@ if( BUILD_TZ_LIB )
endif( )
set_target_properties( date-tz PROPERTIES
POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER "${TZ_HEADERS}"
VERSION "${PROJECT_VERSION}"
SOVERSION "${ABI_VERSION}" )
if( NOT MSVC )
@@ -169,30 +164,26 @@ write_basic_package_version_file( "${version_config}"
COMPATIBILITY SameMajorVersion )

install( TARGETS date
- EXPORT dateConfig
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
+ EXPORT dateConfig )
export( TARGETS date NAMESPACE date:: FILE dateTargets.cmake )
-if (CMAKE_VERSION VERSION_LESS 3.15)
- install(
- FILES include/date/date.h
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
-endif ()
+install(
+ DIRECTORY "${CMAKE_SOURCE_DIR}/include/date"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ PATTERN "chrono_io.h" EXCLUDE
+)

if( BUILD_TZ_LIB )
install( TARGETS date-tz
EXPORT dateConfig
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) # This is for Windows
export( TARGETS date-tz NAMESPACE date:: APPEND FILE dateTargets.cmake )
endif( )

-if( WIN32 AND NOT CYGWIN)
- set( CONFIG_LOC CMake )
-else( )
- set( CONFIG_LOC "${CMAKE_INSTALL_LIBDIR}/cmake/date" )
-endif( )
+
+set( CONFIG_LOC "${CMAKE_INSTALL_LIBDIR}/cmake/date" )
+
install( EXPORT dateConfig
FILE dateTargets.cmake
NAMESPACE date::
10 changes: 3 additions & 7 deletions ports/date/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0001-fix-uwp.patch
0002-fix-cmake-3.14.patch
0002-fix-cmake-install.patch
fix-uninitialized-values.patch #Update the new version please remove this patch
)

Expand All @@ -30,15 +30,11 @@ vcpkg_cmake_configure(
)

vcpkg_cmake_install()

if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
else()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/date)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/date)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
4 changes: 4 additions & 0 deletions ports/date/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
date provides CMake targets:

find_package(date CONFIG REQUIRED)
target_link_libraries(main PRIVATE date::date date::date-tz)
2 changes: 1 addition & 1 deletion ports/date/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "date",
"version": "3.0.1",
"port-version": 3,
"port-version": 4,
"description": "A date and time library based on the C++17 <chrono> header",
"homepage": "https://github.com/HowardHinnant/date",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@
},
"date": {
"baseline": "3.0.1",
"port-version": 3
"port-version": 4
},
"dav1d": {
"baseline": "1.2.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/date.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4f6b5d17f3cf8ffb0330963bf0b6d8efa9175e13",
"version": "3.0.1",
"port-version": 4
},
{
"git-tree": "b3ca1bdc08676cd1bb802421bd94a18872305737",
"version": "3.0.1",
Expand Down