Skip to content

CMake: Why doesn't flatbuffers-config.cmake include BuildFlatBuffers.cmake #7909

@KerstinKeller

Description

@KerstinKeller

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions