The generation of the library interface supplied by this function only
works within the same directory as that the target was defined. By
adding a custom target named GENERATE_<TARGET> now also interface files
will be generated by making a target dependend on the generate target.
Example:
/CMakeLists.txt
set(MY_INCL_SRC ${CMAKE_CURRENT_SOURCE_DIR}/fbs/my_incl.fbs)
flatbuffers_generate_headers(TARGET my_incl
SCHEMAS ${MY_INCL_SRC})
add_subdirectory(app)
/app/CMakeLists.txt
add_executable(app src/test.cpp)
target_link_libraries(app my_incl)
add_dependencies(app GENERATE_my_incl)
Co-authored-by: Derek Bailey <derekbailey@google.com>
Since flatbuffers is using calendar versioning and does not provide
any ABI stability guarantees, use the complete version as SOVERSION
for the shared library rather than just the major component. This
prevents breaking reverse dependencies on incompatible upgrades.
Fixes#7759
This fixes two problems:
1. The project could be build when using own tags which does not follow the pattern v<major>.<minor>.<patch>.
2. The case "tag points to the commit" will be handled correctly by setting VERSION_COMMIT to 0.
This commit resolves https://github.com/google/flatbuffers/issues/7472
Co-authored-by: Axel Sommerfeldt <axel.sommerfeldt@gmail.com>
* CMake find_package fixes (#7323)
Rename FlatbuffersConfigVersion.cmake to match CMake project name
* CMake find_package fixes (#7323)
Rename FlatBuffersTargets to match CMake project name
* Change Rust generated file defaults
After #6731, flatc changed its default behavior
for generating rust code to fix some importing issues.
This was a breaking change which invlidated the patch release,
`flatc 2.0.5` (#7081). This PR reverses the default so we can
release a patch update. However, does break Rust users who work at
HEAD.
* Bump flatc patch version (2.0.6)
Co-authored-by: Casper Neo <cneo@google.com>
* BuildFlatbuffers.cmake: add verbose on build
* BuildFlatbuffers.cmake: properly add *.fb.* files with --grpc argument
When "--grpc" argument is provided as an extra flag, resulting grpc files
should be added as part of the interface library.
This prevent adding .fb.cc files manually to the build.
V2: fix dependency on grpc files
This change checks if the current source directory is a git repository.
If this is not checked the git command picks the commit hash from
parent directory. e.g. when tarball is extracted in a packaging repository.
This commit enables CMake to generate a flatbuffers.pc file on install.
pkg-config eases the utilization of software libraries by enabling the
developers of a library to define how the library should be used.
It can be used as a tool by build systems to find and manage dependencies,
this is notably the default Meson behavior and optionally used by CMake.
This change is for fix warning:
```
CMake Warning (dev) at /home/aoleksy/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
The package name passed to `find_package_handle_standard_args`
(flatbuffers) does not match the name of the calling package (FlatBuffers).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
FindFlatBuffers.cmake:33 (find_package_handle_standard_args)
CMakeLists.txt:6 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
```
This option was in an earlier revision of flatbuffers_generate_headers
but was lost while refactoring by mistake. We have it as a function
argument rather than one of the optional flags so that we can use it to
inform the rule where to place the generated headers, so that the file
location matches the prefix that will be added to the filenames in the
generated files.
Also fixed some of the documentation in the file.
flatbuffers_generate_headers is a function that can be used to generate Flatbuffers headers and binary headers. It uses named argument flags to wrap all the flags relevant to C++ header generation that flatc uses. It generates an interface library that can be added as a dependency of other targets.
flatbuffers_generate_binary_files is a function that can be used to generate Flatbuffers binaries. It uses named argument flags to wrap all the flags relevant to C++ binary generation from JSON file that flatc uses. It generates an interface library that can be added as a dependency of other targets.
* Add RPM packaging support
Using the existing PackageDebian as template add support for
generating an rpm with the package target.
* Restore debian package target
Also add an option to advertise the fact.
* Update package description
C-n-p from README.md
* Update rpm package maintainer