Skip to content

Commit

Permalink
Check pybind version (onnx#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn authored and houseroad committed Aug 23, 2018
1 parent 2cbf740 commit 6146a85
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,18 @@ if(BUILD_ONNX_PYTHON)
"${PYTHON_INCLUDE_DIR}")

# pybind11 is a header only lib
find_package(pybind11)
find_package(pybind11 2.2)
if(pybind11_FOUND)
target_include_directories(onnx_cpp2py_export
PRIVATE ${pybind11_INCLUDE_DIRS})
else()
target_include_directories(
onnx_cpp2py_export
PRIVATE ${ONNX_ROOT}/third_party/pybind11/include)
if(EXISTS ${ONNX_ROOT}/third_party/pybind11/include/pybind11/pybind11.h)
target_include_directories(
onnx_cpp2py_export
PRIVATE ${ONNX_ROOT}/third_party/pybind11/include)
else()
message(FATAL_ERROR "cannot find pybind")
endif()
endif()

if(APPLE)
Expand Down

0 comments on commit 6146a85

Please sign in to comment.