I have cmake 3.10.x and downloaded current protobuf sources 3.6.1. Using cmake I created bin directory "{PROTOBUF_SOURCE_DIR}/bin" where this library is successfully built. As the next step I would like to use this custom tree in my cmake based project. I have
set ( Protobuf_USE_STATIC_LIBS ON )
find_package( Protobuf REQUIRED )
if ( Protobuf_FOUND )
message( STATUS "Protobuf version : ${Protobuf_VERSION}" )
message( STATUS "Protobuf include path : ${Protobuf_INCLUDE_DIRS}" )
message( STATUS "Protobuf libraries : ${Protobuf_LIBRARIES}" )
else()
message( WARNING "Protobuf package not found -> specify search path via PROTOBUF_ROOT variable")
endif()
But how to specify my custom directory tree for cmake to find the necessary stuff.
If I use find_package( Protobuf REQUIRED PATHS ${PROTOBUF_ROOT}/bin/lib/cmake/protobuf )
then I see the following output from cmake :
Protobuf version : 3.6.1
Protobuf include path :
Protobuf libraries :
How can I make cmake to find include paths, libraries and protoc compiler?