Skip to content

Commit

Permalink
Use variables instead of target in cmake < 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed Oct 16, 2019
1 parent cf66a2c commit ae9219a
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit ae9219a

Please sign in to comment.