11diff --git a/CMakeLists.txt b/CMakeLists.txt
2- index 4dd56b6..2ff3e29 100644
2+ index b666eec..66c234d 100644
33--- a/CMakeLists.txt
44+++ b/CMakeLists.txt
5- @@ -65 ,6 +65,27 @@ endif()
5+ @@ -63 ,6 +63,16 @@ endif()
66
77 include(GNUInstallDirs)
88
@@ -15,22 +15,11 @@ index 4dd56b6..2ff3e29 100644
1515+ ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx-operators-ml.proto3
1616+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnx
1717+ )
18- + # install python files
19- + if(BUILD_ONNX_PYTHON)
20- + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_data_pb.py
21- + ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_data_pb2.py
22- + ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_ml_pb2.py
23- + ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_operators_ml_pb2.py
24- + ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_operators_pb.py
25- + ${CMAKE_CURRENT_BINARY_DIR}/onnx/onnx_pb.py
26- + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnx
27- + )
28- + endif()
2918+
3019 set(ONNX_ROOT ${PROJECT_SOURCE_DIR})
3120
3221 # Read ONNX version
33- @@ -116 ,7 +137 ,8 @@ endif()
22+ @@ -104 ,7 +114 ,8 @@ endif()
3423 # find_package Python has replaced PythonInterp and PythonLibs since cmake 3.12
3524 # Use the following command in the future; now this is only compatible with the latest pybind11
3625 # find_package(Python ${PY_VERSION} COMPONENTS Interpreter Development REQUIRED)
@@ -40,28 +29,3 @@ index 4dd56b6..2ff3e29 100644
4029 if(BUILD_ONNX_PYTHON)
4130 find_package(PythonLibs ${PY_VERSION})
4231 endif()
43- @@ -434,6 +456,7 @@ target_link_libraries(onnx PUBLIC onnx_proto)
44- add_onnx_global_defines(onnx)
45-
46- if(BUILD_ONNX_PYTHON)
47- + find_package(Python3 ${PY_VERSION} COMPONENTS Development REQUIRED)
48- if("${PY_EXT_SUFFIX}" STREQUAL "")
49- if(MSVC)
50- set(PY_EXT_SUFFIX ".pyd")
51- @@ -452,10 +475,14 @@ if(BUILD_ONNX_PYTHON)
52- target_include_directories(onnx_cpp2py_export PRIVATE
53- $<BUILD_INTERFACE:${ONNX_ROOT}>
54- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
55- - $<INSTALL_INTERFACE:include>)
56- + ${Python3_INCLUDE_DIRS})
57- + target_link_directories(onnx_cpp2py_export PRIVATE
58- + ${Python3_LIBRARY_DIRS})
59- + target_link_libraries(onnx_cpp2py_export PRIVATE
60- + ${Python3_LIBRARIES})
61-
62- # pybind11 is a header only lib
63- - find_package(pybind11 2.2 CONFIG)
64- + find_package(pybind11 2.2 CONFIG REQUIRED)
65- if(NOT pybind11_FOUND)
66- if(EXISTS "${ONNX_ROOT}/third_party/pybind11/include/pybind11/pybind11.h")
67- add_subdirectory("${ONNX_ROOT}/third_party/pybind11")
0 commit comments