find_path(FLATBUFFERS_INCLUDE_DIR flatbuffers/flatbuffers.h
    HINTS ${FLATBUFFERS_INCLUDE_DIR_HINT})
find_library(FLATBUFFERS_LIBRARIES NAMES flatbuffers
    HINTS ${FLATBUFFERS_LIBRARIES_DIR_HINT})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Flatbuffers DEFAULT_MSG FLATBUFFERS_LIBRARIES FLATBUFFERS_INCLUDE_DIR)

mark_as_advanced(FLATBUFFERS_INCLUDE_DIR FLATBUFFERS_LIBRARIES)

if (FLATBUFFERS_LIBRARIES)
    set(HAVE_FLATBUFFERS "1")
endif()
