-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [date] Fix installation * update version database
- Loading branch information
Showing
7 changed files
with
77 additions
and
41 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters