Commit Graph

29 Commits

Author SHA1 Message Date
cjtallman
043ee2e4e6
Adding a DEPENDENCIES option to the protobuf_generate cmake function (#10014) 2022-05-25 11:00:25 -07:00
mkruskal-google
e9246cd789
Update CMake configuration to add a dependency on Abseil (#9793)
* Proof of concept for CMake Abseil dependency

* Hooked up Abseil linking

* Adding test binaries

* Reverting absl::string view use added for testing.  This will still be broken for automake and bazel

* Adding new cmake config to dist list

* Whitespace fixes and an attempt at fix for Windows Python Release (CMake version < 3.13)

* Hook up LTS to windows cmake

* Fix 'git cd' typo

* Adding clarifying comment for fix

* Adding abseil dependency to protobuf-lite too

* Update submodules instead of cloning abseil-cpp

* Adding explicit pointer to abseil root directory

Co-authored-by: Jason Lunn <jason.lunn@gmail.com>
Co-authored-by: Jorg Brown <jorg.brown@gmail.com>
2022-04-17 22:28:01 -04:00
Arfrever Frehtes Taifersar Arahesis
bd935e101d
cmake: Call get_filename_component() with DIRECTORY mode instead of PATH mode (#9614)
PATH mode is legacy alias for DIRECTORY mode (needed only for CMake <= 2.8.11):
https://cmake.org/cmake/help/latest/command/get_filename_component.html
2022-03-10 12:05:27 -08:00
Timo Lange
4ed3941e27
[CMake] Allow custom plugin options e.g. to generate mocks (#9105)
* add plugin options

* refactored comment message

* added tabs for better readability

* removed newlines as they are not working properly

* allow PROTOC_OPTIONS and EXPORT_MACRO in parallel for protobuf_generate
2022-02-09 08:21:45 -08:00
Igor Sirotin
5d0c30934b Added abilty to pass options to protoc executable from cmake 2021-03-04 13:37:24 +03:00
Afshin Pir
a446e6472b Previously, I had incorrectly used some newer features of CMake(version 3.14). But Now I have updated this code to work with older versions of CMake too. 2020-08-19 17:03:36 -07:00
afshinpir
c91ab40081 Correcting import path selection for protoc
When there are multiple proto file inputs, they are matched with the provided proto directories (-I option). These directories are tested sequentially for each input proto file and if input file is in a subdirectory of provided proto directories, this directory is considered as base for calculating output directory. This update provides same manner and removes limitations imposed by using `${CMAKE_CURRENT_SOURCE_DIR}` as main proto import directory.
1- `${CMAKE_CURRENT_SOURCE_DIR}` is only added to include directories if no import directory is provided and we are not in `APPEND_PATH` mode. In addition it is added as last possible directory to decrease its priority in searching.
2- Each directory is checked against `${_protobuf_include_path}` to find first possible directory which is parent directory of input proto file. If a directory is found, `${_rel_dir}` is calculated based on its value. If no suitable folder is found, an error will be generated.
2020-04-07 10:27:11 -07:00
afshinpir
c62ffaa539 Incorrect selection of base name
protoc just changes last extension. We need this change to support files like a.b.proto in the path.
2020-04-07 10:27:11 -07:00
Falko Axmann
460376190b cmake: extended protobuf_generate
Added an optional `PLUGIN` argument to `protobuf_generate` which
will be forwarded to the `--plugin=` argument of `protoc`.
2020-03-09 15:03:07 -07:00
Xiang Dai
e479410564 delete all duplicate empty blanks (#5758)
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-20 19:28:50 -08:00
Markus Heß
1509e8e3b3 Revert "protobuf_generate(): add relative path to output dir"
This reverts commit 93f6b67eb2.

Protoc adds already the relative path to the output directory.
Therefore, we have to remove this again from the output directory
to prevent adding it twice.
2018-09-28 11:00:55 +02:00
Markus Heß
93f6b67eb2 protobuf_generate(): add relative path to output dir
Without this fix, protobuf_generate() sets the variable _generated_srcs to
${protobuf_generate_PROTOC_OUT_DIR}/${_rel_dir}/${_basename}${_ext}
but generates the files in
${protobuf_generate_PROTOC_OUT_DIR}/${_basename}${_ext}
2018-07-10 18:23:53 +02:00
Steffen Wittmeier
3e84147d53 Fixed protobuf_generate output definition for files relative to the protobuf_generate command 2018-06-25 11:29:56 +02:00
Christian von Arnim
411018e3fb
cmake: Fix DEPENDS of add_custom_command in protobuf_generate 2018-05-15 09:06:54 +02:00
Christian von Arnim
b9c0c5f526
cmake: Add parameter PROTOC_OUT_DIR to protobuf_generate 2018-05-14 09:22:34 +02:00
Christian von Arnim
e8ae76fbde
cmake: Use GENERATE_EXTENSIONS parameter in protobuf_generate 2018-05-14 09:22:08 +02:00
Ben Boeckel
9d0a44c9de cmake: privately add sources to targets
Public sources get added to dependencies of the target as well which can
cause duplicate symbols.
2018-01-19 12:05:00 -05:00
Markus Heß
f7e209951e protobuf_generate: create include path only for proto files 2017-09-29 11:07:36 +02:00
Markus Heß
9829b8f511 protobuf_generate: add EXPORT_MACRO option 2017-09-22 11:44:59 +02:00
Markus Heß
444aecd35a fix protobuf_generate function 2017-09-12 10:00:04 +02:00
Walter Gray
0336770801 add protobuf_generate function, allows use of target_sources where available 2017-06-02 19:57:08 -07:00
Konstantin Podsvirov
eefd1fdd48 CMake: Auto find ZLIB from package config if nedded 2016-08-02 22:37:36 +03:00
Konstantin Podsvirov
71556295ff CMake project updates
A series of improvements:

- Improved Protobuf module compatibility (disabled by default);
- Hide advanced settings;
- Added build tree configuration;
- Added build of examples.
2016-06-04 00:10:07 +03:00
Walter Gray
457a2975f4 Remove __PROTOBUF_PACKAGE_PREFIX 2016-05-28 01:59:58 -07:00
Walter Gray
d13b3d0d96 remove useless cleanup - config.cmake files are executed in their own context. 2016-05-26 23:49:28 -07:00
Feng Xiao
eee38b0c01 Down-integrate from google3. 2015-08-22 18:25:48 -07:00
Konstantin Podsvirov
0be0789018 CMake installation now compatible with origin FindProtobuf module 2015-08-02 16:31:28 +03:00
Konstantin Podsvirov
743ec448c5 Parsing version from configure.ac for CMake project 2015-08-01 02:01:42 +03:00
Konstantin Podsvirov
82983433cf Install protobuf from cmake project
Additional export as "protobuf" package
for importing from other cmake projects
2015-07-31 23:36:00 +03:00