Skip to content

Conversation

@FlorianFranzen
Copy link
Contributor

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 .proto files. I have a patch for this as well, but it is far more intrusive.

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)
@kamilsa kamilsa merged commit 755e875 into qdrvm:master Mar 31, 2021
@FlorianFranzen FlorianFranzen deleted the cmake-external-protoc branch March 31, 2021 15:05
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants