-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
CMake protobuf_generate is missing cpp_out directory #12450
Comments
I tried to investigate this issue further and in my opinion there is an error in the custom command of protobuf-generate.cmake starting at line 138.
In my opinion |
Thanks for looking into this! Would you be willing to send us a PR with this fix? |
I believe the problem is actually the variable For what it is worth, I made it work for myself by
I have not investigated further to understand why the protobuf compiler variable was not set, as I am not extremely competent on cmake. But I thought this might help someone. |
This should be fixed in b302597. |
…tory I confirmed that this test would catch the problem from #12450. PiperOrigin-RevId: 525865658
…tory I confirmed that this test would catch the problem from #12450. PiperOrigin-RevId: 525865658
…tory I confirmed that this test would catch the problem from #12450. PiperOrigin-RevId: 525865658
…tory I confirmed that this test would catch the problem from #12450. PiperOrigin-RevId: 526165526
What version of protobuf and what language are you using?
v22.2
What operating system (Linux, Windows, ...) and version?
Debian 11
What runtime / compiler are you using (e.g., python version or gcc version)
GCC 12.2.0
What did you do?
Steps to reproduce the behavior:
build
and go into it.cmake ../
andmake
What did you expect to see
I expect that addressbook.proto is compiled by the protoc and resulted .pb.c and .pb.h are available to build add_person.cc
What did you see instead?
When protoc is running on addressbook.proto you get the output: cpp_out: No such file or directory and off course building add_preson.cc fails because addressbook.pb.h is not available.
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
cmake ../
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.13")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/stefan/sources/motionConnect/protobuf/examples/build
❯ make
[ 12%] Running cpp protocol buffer compiler on addressbook.proto
make[2]: cpp_out: No such file or directory
[ 25%] Building CXX object CMakeFiles/add_person_cpp.dir/add_person.cc.o
/home/stefan/sources/motionConnect/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/build.make:83: CMakeFiles/add_person_cpp.dir/add_person.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/add_person_cpp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Anything else we should know about your project / environment
The text was updated successfully, but these errors were encountered: