diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 9d81dc5ed73..2729c2769e7 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -485,15 +485,13 @@ endif() # ---[ pybind11 find_package(pybind11 CONFIG) -if((DEFINED pybind11_DIR) AND pybind11_DIR) - get_target_property(pybind11_INCLUDE_DIRS pybind11::pybind11 INTERFACE_INCLUDE_DIRECTORIES) -else() +if(NOT pybind11_FOUND) find_package(pybind11) endif() if(pybind11_FOUND) message(STATUS "System pybind11 found") - message(STATUS "pybind11l include dirs: " ${pybind11_INCLUDE_DIRS}) + message(STATUS "pybind11 include dirs: " "${pybind11_INCLUDE_DIRS}") include_directories(SYSTEM ${pybind11_INCLUDE_DIRS}) else() message(STATUS "Using third_party/pybind11.")