I want to set Protobuf_INCLUDE_DIRS
to a directory of my choosing, however, I am not sure how to do that.
$ locate FindProtobuf.cmake
/usr/share/cmake-3.16/Modules/FindProtobuf.cmake
I can see that in FindProtobuf.cmake
, we have these:
if(Protobuf_FOUND)
set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIR})
endif()
I want it to be set to the second option here:
$ which -a protoc
/home/mona/anaconda3/bin/protoc
/usr/local/bin/protoc
However, it is set to the first option /home/mona/anaconda3/bin/protoc
despite forcing it in ~/.bashrc to second option: /usr/local/bin/protoc
using below command: alias protoc=/usr/local/bin/protoc
The version that my program requires is 3.6.1 and alias protoc=/usr/local/bin/protoc assures that. However, ProtobufCMake forces the path to be /home/mona/anaconda3/bin/protoc
and that version is 3.13.0.
A bit about the problem I am facing. I am using openpose and for installing it in Ubuntu 20.04, I am using CMake. It requires the protobuf version to be 3.6.1.
More on here https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/1817
Here are the messages:
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:469 (file):
file STRINGS file "/usr/include/google/protobuf/stubs/common.h" cannot be
read.
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:475 (math):
math cannot parse the expression: " / 1000000": syntax error, unexpected
exp_DIVIDE (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:476 (math):
math cannot parse the expression: " / 1000 % 1000": syntax error,
unexpected exp_DIVIDE (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Error at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:477 (math):
math cannot parse the expression: " % 1000": syntax error, unexpected
exp_MOD (2).
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)
CMake Warning at /usr/share/cmake-3.16/Modules/FindProtobuf.cmake:499 (message):
Protobuf compiler version 3.13.0 doesn't match library version
ERROR.ERROR.ERROR
Call Stack (most recent call first):
CMakeLists.txt:429 (find_package)