Lua Plugin: Require Lua bindings
@@ -4,8 +4,9 @@ if (DEPENDENCY_PHASE)
set (LUA_REQUIRED_VERSION 5.1)
find_package(Lua ${LUA_REQUIRED_VERSION} QUIET)
find_swig()
+ check_binding_included ("swig_lua" BINDING_WAS_ADDED SUBDIRECTORY "swig/lua" SILENT)
- if (LUA_FOUND AND SWIG_FOUND)
+ if (LUA_FOUND AND SWIG_FOUND AND BINDING_WAS_ADDED)
include (LibAddMacros)
add_custom_command (OUTPUT runtime.h
@@ -17,6 +18,8 @@ if (DEPENDENCY_PHASE)
set_source_files_properties (lua.cpp PROPERTIES COMPILE_FLAGS "${SWIG_COMPILE_FLAGS}")
elseif (NOT LUA_FOUND)
remove_plugin (lua "Lua libs (>= liblua${LUA_REQUIRED_VERSION}-dev) not found")
+ elseif (NOT BINDING_WAS_ADDED)
+ remove_plugin (lua "swig_lua binding is required")
else ()
remove_plugin (lua "swig not found")
endif ()
