Skip to content

Commit

Permalink
cmake: date as INTERFACE target, to enable automatic include_directory
Browse files Browse the repository at this point in the history
       (for cases where just date.h, but not "tz.h and its lib" are needed)
  • Loading branch information
ajneu authored and HowardHinnant committed Dec 26, 2017
1 parent 44c2515 commit 9178193
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/ )

Expand Down

0 comments on commit 9178193

Please sign in to comment.