Skip to content

Commit

Permalink
These two lines allow the scope of the property <target> for the public
Browse files Browse the repository at this point in the history
headers to be available when making use of the add_subdirectory from a
parent project.

This will allow other add_subdirectory's to reference the headers during
the build process of cmake.
  • Loading branch information
Lawrence O'Boyle committed Jul 22, 2020
1 parent 7d31d1e commit 4da34b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ list(APPEND restclient-cpp_PUBLIC_HEADERS
# target_sources(restclient-cpp PRIVATE ${restclient-cpp_PUBLIC_HEADERS})
set_property(TARGET restclient-cpp PROPERTY
PUBLIC_HEADER ${restclient-cpp_PUBLIC_HEADERS})
target_include_directories(restclient-cpp PRIVATE include)
target_include_directories(restclient-cpp
PRIVATE include
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
)

if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/version.h.in")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/version.h.in" [=[
Expand Down

0 comments on commit 4da34b7

Please sign in to comment.