cmake-conan icon indicating copy to clipboard operation
cmake-conan copied to clipboard

Do I need to use find_package(Protobuf REQUIRED) when using cmake.conan

Open ShamanTcler opened this issue 5 years ago • 0 comments

Building from the blog post: https://blog.conan.io/2019/03/06/Serializing-your-data-with-Protobuf.html

A CmakeLists.txt file is included. cmakelists.txt

So to activate the function: protobuf_generate_cpp

I need to do a find_package(Protobuf REQUIRED) ...... is this the intent? (If so I can understand it, as Qt has similar issues i.e. find_package to activate auto_moc.)

The reason I ask is that for the most part declaring a lib in the conan_cmake_run call seems to be equivalent to having done a find_package.

i.e. I now use the CONAN_PKG:: syntax

target_link_libraries(${PROJECT_NAME} CONAN_PKG::protobuf)

ShamanTcler avatar Mar 07 '19 19:03 ShamanTcler