Commit aeb38e01 authored by Branislav Katreniak's avatar Branislav Katreniak

cmake: set target_include_directories on build interface

Consumers of non-installed build directory don't have to manually
set include dirs.
parent 16b14a2c
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
# Tests ========================================================================
if(BUILD_TESTING)
......
......@@ -58,7 +58,10 @@ set(capnp_schemas
add_library(capnp ${capnp_sources})
target_link_libraries(capnp kj)
#make sure external consumers don't need to manually set the include dirs
target_include_directories(capnp INTERFACE $<INSTALL_INTERFACE:include>)
target_include_directories(capnp INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:include>
)
install(TARGETS capnp ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES ${capnp_headers} ${capnp_schemas} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/capnp")
......
......@@ -63,7 +63,10 @@ endif()
#make sure the lite flag propagates to all users (internal + external) of this library
target_compile_definitions(kj PUBLIC ${CAPNP_LITE_FLAG})
#make sure external consumers don't need to manually set the include dirs
target_include_directories(kj INTERFACE $<INSTALL_INTERFACE:include>)
target_include_directories(kj INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:include>
)
install(TARGETS kj ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES ${kj_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj")
install(FILES ${kj-parse_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/kj/parse")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment