shaochuan / cmake-protobuf-example

Minimal example of using CMake to manage C++ project with protobuf.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make fails with unresolved externals

msandres13 opened this issue · comments

When I use the example unchanged I get unresolved externals to protobuf lib since the variable in the root script is not set.
I propose to move the FindLibrary to protobuf into the root CMakeList.txt since the variables in leafs go out of scope when returning to the root.

Here is a diff to make it work.

unresolved_external_fix.diff.txt