How does PROTOBUF_GENERATE_CPP know where to pick up the protoc binary from?
I have compiled protobuf locally and would like to point my CMakeLists.txt to the installed binary ( myfolder/protobuf-install/bin/protoc ) and not the system binary ( /usr/bin/protoc )
Normally for Boost, I would just set the BOOST_ROOT to my installed folder and it will find all the include_directories, libraries, etc.
How should it be done for Protobuf. I dont see any prefix option in the FindProtobuf.cmake.
set( Protobuf_SRC_ROOT_FOLDER "${CMAKE_SOURCE_DIR}/myfolder/")
find_package(Protobuf MODULE REQUIRED)
The error is
file STRINGS file "/usr/include/google/protobuf/stubs/common.h" cannot be read.
Call Stack (most recent call first):
CMakeLists.txt:17 (find_package)
Ofcourse, the above path is in myfolder/ and not in the system folder. But why is protobuf looking for includes in the system path, when I have explicitly declared the root path as myfolder/