I'm trying to build a protobuf project on Ubuntu using CMake.
Protobuf version 3.5.1 was builded on the same machine successfully. To use this specific version, the flag NO_DEFAULT_PATH
is passed to find_package
and the new location of the protobuf related cmake files is passed as well.
My current CMakeLists.txt:
set (Protobuf_DIR "/home/ubuntu/Projects/Protobuf/build-host/lib/cmake/protobuf")
find_package(Protobuf REQUIRED NO_DEFAULT_PATH)
message(" --> PROTOBUF LIB: ${PROTOBUF_LIBRARIES}")
message(" --> PROTOBUF INCLUDE: ${PROTOBUF_INCLUDE_DIRS}")
message(" --> PROTOBUF VERSION: ${Protobuf_VERSION}")
message(" --> PROTOBUF Found: ${Protobuf_FOUND}")
The output:
--> PROTOBUF LIB:
--> PROTOBUF INCLUDE:
--> PROTOBUF VERSION: 3.5.1
--> PROTOBUF Found: 1
It claims, that protobuf has been found, BUT PROTOBUF_LIBRARIES
and PROTOBUF_INCLUDE_DIRS
are empty.
How can I solve this? Any hints?