Python 2 Plugin: Require Python 2 bindings
@@ -3,10 +3,11 @@ include (LibAddBinding)
if (DEPENDENCY_PHASE)
find_package(Python2Libs 2.7 QUIET)
find_swig()
+ check_binding_included ("swig_python2" BINDING_WAS_ADDED SUBDIRECTORY "swig/python2" SILENT)
if (PYTHON2LIBS_VERSION_STRING MATCHES "^3\\.[0-9]+")
remove_plugin (python2 "python2 is for python 2.7 only and not ${PYTHON2LIBS_VERSION_STRING}")
- elseif (PYTHON2LIBS_FOUND AND SWIG_FOUND)
+ elseif (PYTHON2LIBS_FOUND AND SWIG_FOUND AND BINDING_WAS_ADDED)
include (LibAddMacros)
add_custom_command (OUTPUT runtime.h
@@ -18,6 +19,8 @@ if (DEPENDENCY_PHASE)
set_source_files_properties ("python.cpp" PROPERTIES COMPILE_FLAGS "${SWIG_COMPILE_FLAGS}")
elseif (NOT PYTHON2LIBS_FOUND)
remove_plugin (python2 "python 2 libs (libpython-dev) not found")
+ elseif (NOT BINDING_WAS_ADDED)
+ remove_plugin (python2 "swig_python2 binding is required")
else ()
remove_plugin (python2 "swig not found")
endif ()
