pytorch/cmake/Modules/Findpybind11.cmake
Hans Gaiser 567842e68d Check system dependencies first
Summary:
This PR changes the cmake of Caffe2 to look for system dependencies before resorting to the submodules in `third-party`. Only googletest should logically be in third-party, the other libraries should ideally be installed as system dependencies by the user. This PR adds system dependency checks for Gloo, CUB, pybind11, Eigen and benchmark, as these were missing from the cmake files.

In addition it removes the execution of `git submodule update --init` in cmake. This seems like bad behavior to me, it should be up to the user to download submodules and manage the git repository.
Closes https://github.com/caffe2/caffe2/pull/382

Differential Revision: D5124123

Pulled By: Yangqing

fbshipit-source-id: cc34dda58ffec447874a89d01058721c02a52476
2017-05-24 14:31:51 -07:00

18 lines
499 B
CMake

# Try to find the pybind11 library and headers.
# pybind11_FOUND - system has pybind11
# pybind11_INCLUDE_DIRS - the pybind11 include directory
find_path(pybind11_INCLUDE_DIR
NAMES pybind11/pybind11.h
DOC "The directory where pybind11 includes reside"
)
set(pybind11_INCLUDE_DIRS ${pybind11_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(pybind11
FOUND_VAR pybind11_FOUND
REQUIRED_VARS pybind11_INCLUDE_DIR
)
mark_as_advanced(pybind11_FOUND)