Skip to content

Commit

Permalink
update from upstream, add extra target for extra headerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
allspark committed Nov 22, 2020
1 parent 35e9282 commit dd55d5b
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,20 @@ target_include_directories( date INTERFACE
# adding header sources just helps IDEs
target_sources( date INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/date.h
# the rest of these are not currently part of the public interface of the library:
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/solar_hijri.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/islamic.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/iso_week.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/julian.h>
)

add_library(extra INTERFACE)
add_library(date::extra ALIAS extra)
target_sources(extra INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/solar_hijri.h
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE:include>/date/islamic.h
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>$<INSTALL_INTERFACE: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 )
set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h)
set_target_properties( extra PROPERTIES PUBLIC_HEADER "include/date/islamic.h;include/date/solar_hijri.h;include/date/julian.h")
endif ()

# These used to be set with generator expressions,
Expand Down Expand Up @@ -166,10 +171,10 @@ if( BUILD_TZ_LIB )
PUBLIC_HEADER "${TZ_HEADERS}"
VERSION "${PROJECT_VERSION}"
SOVERSION "${ABI_VERSION}" )
if( NOT MSVC )
find_package( Threads )
target_link_libraries( date-tz PUBLIC Threads::Threads )
endif( )

find_package( Threads )
target_link_libraries( date-tz PUBLIC Threads::Threads )

if( NOT USE_SYSTEM_TZ_DB AND NOT MANUAL_TZ_DB )
find_package( CURL REQUIRED )
target_include_directories( date-tz SYSTEM PRIVATE ${CURL_INCLUDE_DIRS} )
Expand All @@ -192,6 +197,11 @@ install( TARGETS date
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
export( TARGETS date NAMESPACE date:: FILE dateTargets.cmake )

install( TARGETS extra
EXPORT dateTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date)
export(TARGETS extra NAMESPACE date:: APPEND FILE dateTargets.cmake)

install( TARGETS iso_week
EXPORT dateTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
Expand Down Expand Up @@ -225,9 +235,6 @@ install( EXPORT dateTargets
FILE dateTargets.cmake
NAMESPACE date::
DESTINATION ${CONFIG_LOC} )
install (
FILES cmake/dateConfig.cmake "${version_config}"
DESTINATION ${CONFIG_LOC})

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

0 comments on commit dd55d5b

Please sign in to comment.