Search for pybind11 only at the git submodule location

- Fixes a bug where pybind11 is found in the installation directory
This commit is contained in:
Matthias Hochsteger 2017-01-09 19:16:53 +01:00
parent 35a8281d52
commit 77dde0977b

View File

@ -59,7 +59,7 @@ endif(NOT WIN32)
#######################################################################
if (USE_PYTHON)
find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include)
find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
if( NOT PYBIND_INCLUDE_DIR )
execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include)