Attach header directory information to the "flatbuffers" library target (#4849)

* Attach header directory information to the "flatbuffers" library target, if the CMake version supports it.

* Cleanup and documentation update
This commit is contained in:
Vladimir Glavnyy
2018-08-07 04:59:29 +07:00
committed by Wouter van Oortmerssen
parent 42515cfd33
commit 27e4f43b77
2 changed files with 30 additions and 2 deletions

View File

@@ -180,7 +180,10 @@ include_directories(include)
include_directories(grpc)
if(FLATBUFFERS_BUILD_FLATLIB)
add_library(flatbuffers STATIC ${FlatBuffers_Library_SRCS})
add_library(flatbuffers STATIC ${FlatBuffers_Library_SRCS})
# CMake > 2.8.11: Attach header directory for when build via add_subdirectory().
target_include_directories(flatbuffers INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
endif()
if(FLATBUFFERS_BUILD_FLATC)