Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v22.2 integration with cmake doesn't work #12374

Closed
JanuszL opened this issue Mar 30, 2023 · 0 comments
Closed

v22.2 integration with cmake doesn't work #12374

JanuszL opened this issue Mar 30, 2023 · 0 comments
Assignees
Labels

Comments

@JanuszL
Copy link

JanuszL commented Mar 30, 2023

What version of protobuf and what language are you using?
Version: main/v22.2
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux

What runtime / compiler are you using (e.g., python version or gcc version)
gcc 10.2.1 20210130
cmake 3.25.0

What did you do?
Steps to reproduce the behavior:

  1. docker run --rm -ti quay.io/pypa/manylinux2014_x86_64
  2. inside:
git clone https://github.com/protocolbuffers/protobuf && \
cd protobuf/ && \
git checkout v22.2 && \
git submodule init && git submodule update --init --recursive && \
mkdir build && cd build && \
cmake .. && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" && \
make install && \
cd ../examples/ && mkdir build && cd build && \
cmake ../ && make -j 12
  1. integration with cmake cannot find protoc
[ 12%] Running cpp protocol buffer compiler on addressbook.proto
make[2]: cpp_out: Command not found
[ 25%] Building CXX object CMakeFiles/add_person_cpp.dir/add_person.cc.o
/opt/protobuf/examples/add_person.cc:9:10: fatal error: addressbook.pb.h: No such file or directory
    9 | #include "addressbook.pb.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/add_person_cpp.dir/add_person.cc.o] Error 1
make[1]: *** [CMakeFiles/add_person_cpp.dir/all] Error 2
make: *** [all] Error 2

What did you expect to see
The example works, protoc can be found by cmake
What did you see instead?
Cmake cannot find protoc, so the issued command is incomplette

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Anything else we should know about your project / environment

@JanuszL JanuszL added the untriaged auto added to all issues by default when created. label Mar 30, 2023
@anandolee anandolee removed the untriaged auto added to all issues by default when created. label Mar 30, 2023
copybara-service bot pushed a commit that referenced this issue Apr 19, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525572684
copybara-service bot pushed a commit that referenced this issue Apr 19, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525572684
mkruskal-google pushed a commit that referenced this issue May 4, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525591320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants