Allow to use functions from `BuildFlatBuffers.cmake` from a flatbuffers installation installed with CMake. (#7912)
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
parent
aa6848fbf6
commit
d6d83c3a92
|
@ -59,6 +59,9 @@ function(build_flatbuffers flatbuffers_schemas
|
|||
if(FLATBUFFERS_FLATC_EXECUTABLE)
|
||||
set(FLATC_TARGET "")
|
||||
set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE})
|
||||
elseif(TARGET flatbuffers::flatc)
|
||||
set(FLATC_TARGET flatbuffers::flatc)
|
||||
set(FLATC flatbuffers::flatc)
|
||||
else()
|
||||
set(FLATC_TARGET flatc)
|
||||
set(FLATC flatc)
|
||||
|
@ -211,6 +214,9 @@ function(flatbuffers_generate_headers)
|
|||
if(FLATBUFFERS_FLATC_EXECUTABLE)
|
||||
set(FLATC_TARGET "")
|
||||
set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE})
|
||||
elseif(TARGET flatbuffers::flatc)
|
||||
set(FLATC_TARGET flatbuffers::flatc)
|
||||
set(FLATC flatbuffers::flatc)
|
||||
else()
|
||||
set(FLATC_TARGET flatc)
|
||||
set(FLATC flatc)
|
||||
|
@ -382,6 +388,9 @@ function(flatbuffers_generate_binary_files)
|
|||
if(FLATBUFFERS_FLATC_EXECUTABLE)
|
||||
set(FLATC_TARGET "")
|
||||
set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE})
|
||||
elseif(TARGET flatbuffers::flatc)
|
||||
set(FLATC_TARGET flatbuffers::flatc)
|
||||
set(FLATC flatbuffers::flatc)
|
||||
else()
|
||||
set(FLATC_TARGET flatc)
|
||||
set(FLATC flatc)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersTargets.cmake" OPTIONAL)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/FlatcTargets.cmake" OPTIONAL)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersSharedTargets.cmake" OPTIONAL)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/BuildFlatBuffers.cmake" OPTIONAL)
|
Loading…
Reference in New Issue