CMake: Allow build system to provide protobuf compiler#703
Merged
kamilsa merged 1 commit intoqdrvm:masterfrom Mar 31, 2021
Merged
CMake: Allow build system to provide protobuf compiler#703kamilsa merged 1 commit intoqdrvm:masterfrom
kamilsa merged 1 commit intoqdrvm:masterfrom
Conversation
When building without Hunter, it is desirable to pass the path to protoc and the protobuf include directory from the build system. Allow these variables to be overridden. Fixes the error: | CMake Error at cmake/functions.cmake:52 (message): | Protobuf_PROTOC_EXECUTABLE is empty | Call Stack (most recent call first): | cmake/functions.cmake:96 (compile_proto_to_cpp) | src/crypto/protobuf/CMakeLists.txt:6 (add_proto_library)
xDimon
approved these changes
Mar 30, 2021
Harrm
approved these changes
Mar 31, 2021
Harrm
pushed a commit
that referenced
this pull request
Nov 5, 2021
When building without Hunter, it is desirable to pass the path to protoc and the protobuf include directory from the build system. Allow these variables to be overridden. Fixes the error: | CMake Error at cmake/functions.cmake:52 (message): | Protobuf_PROTOC_EXECUTABLE is empty | Call Stack (most recent call first): | cmake/functions.cmake:96 (compile_proto_to_cpp) | src/crypto/protobuf/CMakeLists.txt:6 (add_proto_library) Co-authored-by: Garrett Brown <garrett.brown@aclima.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Referenced issues
This ports the relevant CMake patches from libp2p/cpp-libp2p#59 over to kagome,
Not sure if the license is compatible and it might be required that @eigendude signs the CLA as this is his patch, just applied to a different code base.
Description of the Change
When building without Hunter, it is desirable to pass the path to protoc and
the protobuf include directory from the build system. Allow these variables
to be overridden.
Fixes the error:
| CMake Error at cmake/functions.cmake:52 (message):
| Protobuf_PROTOC_EXECUTABLE is empty
| Call Stack (most recent call first):
| cmake/functions.cmake:96 (compile_proto_to_cpp)
| src/crypto/protobuf/CMakeLists.txt:6 (add_proto_library)
Benefits
Support building kagome without hunter.
Possible Drawbacks
None
Alternate Designs
The alternative would be to not use custom functions at all but to use the functions provided by CMake or the protobuffer CMake pacakge config to compile any
.protofiles. I have a patch for this as well, but it is far more intrusive.