From a539cc1790aed8a1549a6cde5cdddc0876615851 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 27 Dec 2018 19:29:03 +0100 Subject: [PATCH 1/1] we cannot use PYBIND11 without PYTHONLIBS No idea why pybind11 does not do it automatically. Maybe they think that pybind11 can work (ie generate code) even if that code cannot be compiled, but that's a bit ... strange. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02a0859d10..c8cbaee659 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -850,6 +850,9 @@ endif() # Python binding, generated with pybind11 set(PYBIND11_CPP_STANDARD -std=c++11) find_package(pybind11) +if(NOT PYTHONLIBS_FOUND) + set(pybind11_FOUND OFF) +endif() option(enable_python "Whether the Python bindings are activated." ${pybind11_FOUND}) # ON by default if dependencies are met if(enable_python) -- 2.20.1