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

Use protobuf variables instead of target in cmake < 3.9 #60

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tools/onnx2bnn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,21 @@ add_library(onnx2bnn
target_link_libraries(onnx2bnn
glog::glog
onnx
protobuf::libprotobuf
flatbuffers
)
if (CMAKE_VERSION VERSION_LESS "3.9.0")
target_link_libraries(onnx2bnn
# ${PROTOBUF_LIBRARIES} and ${PROTOBUF_INCLUDE_DIRS} is for cmake 3.5
${PROTOBUF_LIBRARIES} ${Protobuf_LIBRARIES})
target_include_directories(onnx2bnn
PUBLIC
${PROTOBUF_INCLUDE_DIRS} ${Protobuf_INCLUDE_DIRS})
else()
target_link_libraries(onnx2bnn
protobuf::libprotobuf
)
endif()

target_include_directories(onnx2bnn
PUBLIC
${PROJECT_SOURCE_DIR}
Expand Down