mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-28 17:28:15 +08:00
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:
parent
44c2515280
commit
9178193ad2
@ -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( TARGETS tz DESTINATION lib )
|
||||||
install( DIRECTORY ${HEADER_FOLDER}/ DESTINATION include/ )
|
install( DIRECTORY ${HEADER_FOLDER}/ DESTINATION include/ )
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user