Skip to content

Commit 5a45eec

Browse files
committed
update from upstream, add extra target for extra headerfiles
1 parent 35e9282 commit 5a45eec

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

CMakeLists.txt

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,20 @@ target_include_directories( date INTERFACE
6767
# adding header sources just helps IDEs
6868
target_sources( date INTERFACE
6969
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/date.h
70-
# the rest of these are not currently part of the public interface of the library:
71-
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/solar_hijri.h>
72-
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/islamic.h>
73-
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/iso_week.h>
74-
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/julian.h>
7570
)
71+
72+
add_library(extra INTERFACE)
73+
add_library(date::extra ALIAS extra)
74+
target_sources(extra INTERFACE
75+
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/solar_hijri.h
76+
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/islamic.h
77+
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/julian.h
78+
)
79+
7680
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
7781
# public headers will get installed:
78-
set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h )
82+
set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h)
83+
set_target_properties( extra PROPERTIES PUBLIC_HEADER "include/date/islamic.h;include/date/solar_hijri.h;include/date/julian.h")
7984
endif ()
8085

8186
# These used to be set with generator expressions,
@@ -166,10 +171,10 @@ if( BUILD_TZ_LIB )
166171
PUBLIC_HEADER "${TZ_HEADERS}"
167172
VERSION "${PROJECT_VERSION}"
168173
SOVERSION "${ABI_VERSION}" )
169-
if( NOT MSVC )
170-
find_package( Threads )
171-
target_link_libraries( date-tz PUBLIC Threads::Threads )
172-
endif( )
174+
175+
find_package( Threads )
176+
target_link_libraries( date-tz PUBLIC Threads::Threads )
177+
173178
if( NOT USE_SYSTEM_TZ_DB AND NOT MANUAL_TZ_DB )
174179
find_package( CURL REQUIRED )
175180
target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} )
@@ -192,6 +197,11 @@ install( TARGETS date
192197
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
193198
export( TARGETS date NAMESPACE date:: FILE dateTargets.cmake )
194199

200+
install( TARGETS extra
201+
EXPORT dateTargets
202+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date)
203+
export(TARGETS extra NAMESPACE date:: APPEND FILE dateTargets.cmake)
204+
195205
install( TARGETS iso_week
196206
EXPORT dateTargets
197207
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
@@ -202,6 +212,11 @@ if (CMAKE_VERSION VERSION_LESS 3.15)
202212
install(
203213
FILES include/date/date.h
204214
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
215+
216+
install(
217+
FILES include/date/islamic.h include/date/solar_hijri.h include/date/julian.h
218+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
219+
205220
endif ()
206221

207222
if( BUILD_TZ_LIB )
@@ -225,9 +240,6 @@ install( EXPORT dateTargets
225240
FILE dateTargets.cmake
226241
NAMESPACE date::
227242
DESTINATION ${CONFIG_LOC} )
228-
install (
229-
FILES cmake/dateConfig.cmake "${version_config}"
230-
DESTINATION ${CONFIG_LOC})
231243

232244
configure_file(cmake/dateConfig.cmake.in dateConfig.cmake @ONLY)
233245
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dateConfig.cmake"

0 commit comments

Comments
 (0)