Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong protobuf cmake variable when cmake < 3.6.0 #21

Merged
merged 1 commit into from
May 8, 2019

Conversation

daquexian
Copy link
Contributor

@daquexian daquexian commented May 8, 2019

According to cmake doc, FindProtobuf.cmake defines PROTOBUF_* instead of Protobuf_* in cmake < 3.6, so cmake 3.5 users (including ubuntu 16.04 users which install cmake 3.5.1 by apt install) will get link errors like /usr/bin/ld: source/onnx/libonnx.so: undefined reference to google::protobuf::RepeatedField<unsigned long>::unsafe_data() const' and fail to build converter since Protobuf_* is empty.

What's more, it's more proper to use Protobuf_INCLUDE_DIRS instead of Protobuf_INCLUDE_DIR according to the doc, the latter one is expected to be set by the user and even doesn't exist in cmake 3.0, so I fixed it too.

Refer: cmake 3.5 doc
cmake 3.6 doc
cmake 3.0 doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants