From: Martin Quinson Date: Thu, 27 Dec 2018 18:29:03 +0000 (+0100) Subject: we cannot use PYBIND11 without PYTHONLIBS X-Git-Tag: v3_22~747 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a539cc1790aed8a1549a6cde5cdddc0876615851?hp=1643b1711d3403b8c3ae7091e38cb69f5f9a1272 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. --- 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)