BuildFlatBuffers.cmake includes functionality to simply generate Flatbuffer headers for C++.
It is installed together with the flatbuffers-config.cmake file, however, for those functions to be available, it needs to include it, too.
|
include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersTargets.cmake" OPTIONAL) |
|
include("${CMAKE_CURRENT_LIST_DIR}/FlatcTargets.cmake" OPTIONAL) |
|
include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersSharedTargets.cmake" OPTIONAL) |
would additionally need the following line:
include("${CMAKE_CURRENT_LIST_DIR}/BuildFlatBuffers.cmake" OPTIONAL)
Then, using the functions like flatbuffers_generate_headers would work out of the box, after having called find_package(FlatBuffers REQUIRED)