2018-11-20 00:48:22 +00:00
|
|
|
|
2020-02-04 03:33:14 +00:00
|
|
|
if(onnxruntime_PREFER_SYSTEM_LIB)
|
|
|
|
|
find_package(pybind11)
|
|
|
|
|
endif()
|
2018-11-20 00:48:22 +00:00
|
|
|
|
2020-02-04 03:33:14 +00:00
|
|
|
if(NOT TARGET pybind11::module)
|
|
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
|
|
set(pybind11_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/pybind11/src/pybind11/include)
|
|
|
|
|
set(pybind11_URL https://github.com/pybind/pybind11.git)
|
2021-04-29 18:54:57 +00:00
|
|
|
set(pybind11_TAG v2.6.2)
|
2020-02-04 03:33:14 +00:00
|
|
|
|
|
|
|
|
ExternalProject_Add(pybind11
|
2018-11-20 00:48:22 +00:00
|
|
|
PREFIX pybind11
|
|
|
|
|
GIT_REPOSITORY ${pybind11_URL}
|
|
|
|
|
GIT_TAG ${pybind11_TAG}
|
|
|
|
|
CONFIGURE_COMMAND ""
|
|
|
|
|
BUILD_COMMAND ""
|
|
|
|
|
INSTALL_COMMAND ""
|
2020-02-04 03:33:14 +00:00
|
|
|
)
|
|
|
|
|
set(pybind11_dep pybind11)
|
|
|
|
|
else()
|
|
|
|
|
set(pybind11_lib pybind11::module)
|
2020-11-30 20:02:48 +00:00
|
|
|
endif()
|