Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
we cannot use PYBIND11 without PYTHONLIBS
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 27 Dec 2018 18:29:03 +0000 (19:29 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 27 Dec 2018 18:29:09 +0000 (19:29 +0100)
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

index 02a0859..c8cbaee 100644 (file)
@@ -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)