cmake: date as INTERFACE target, to enable automatic include_directory

(for cases where just date.h, but not "tz.h and its lib" are needed)
This commit is contained in:
ajneu 2017-12-01 21:15:32 +01:00 committed by Howard Hinnant
parent 44c2515280
commit 9178193ad2

View File

@ -72,6 +72,19 @@ target_include_directories(tz PUBLIC
>
)
add_library(date INTERFACE) # an interface (not a library), to enable automatic include_directory (for when just date.h, but not "tz.h and its lib" are needed)
# add include folders to the INTERFACE and targets that consume it
target_include_directories(date INTERFACE
$<BUILD_INTERFACE:
${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FOLDER}
>
$<INSTALL_INTERFACE:
include
>
)
install( TARGETS tz DESTINATION lib )
install( DIRECTORY ${HEADER_FOLDER}/ DESTINATION include/ )