Associate the required include directory with the benchmark library (#393)

Using target_include_directories CMake will implicitly add the the
necessary include paths to targets which link against the benchmark
library. This is useful when the benchmark repo is included as a
subdirectory in another CMake build.
This commit is contained in:
David Kruger 2017-05-23 11:40:31 -04:00 committed by Dominic Hamon
parent febd0d7a7a
commit 15e9ebaf83

View File

@ -18,6 +18,9 @@ set_target_properties(benchmark PROPERTIES
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
target_include_directories(benchmark PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
# Link threads.
target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})