Added support for automatically select Lua 5.2 is it's available, then falling back to checking for Lua 5.1 otherwise.

This commit is contained in:
Robert Osfield
2013-10-04 20:42:23 +00:00
parent d260b16981
commit da2d7e2dde
2 changed files with 7 additions and 5 deletions

View File

@@ -539,8 +539,10 @@ ELSE()
FIND_PACKAGE(Asio)
ENDIF()
FIND_PACKAGE(ZeroConf)
#FIND_PACKAGE(Lua52)
FIND_PACKAGE(Lua51)
FIND_PACKAGE(Lua52)
IF (NOT (LUA_LIBRARIES AND LUA_INCLUDE_DIR))
FIND_PACKAGE(Lua51)
ENDIF()
FIND_PACKAGE(V8)
FIND_PACKAGE(PythonLibs)
ENDIF()

View File

@@ -17,8 +17,6 @@
using namespace lua;
#define USE_USERDATA_FOR_POINTER 1
static int getProperty(lua_State * _lua)
{
const LuaScriptEngine* lse = reinterpret_cast<const LuaScriptEngine*>(lua_topointer(_lua, lua_upvalueindex(1)));
@@ -275,7 +273,9 @@ public:
virtual void apply(const osg::Matrixd& value) { _lsg->pushValue(value); }
};
#define lua_rawlen lua_strlen
#if LUA_VERSION_NUM<=501
#define lua_rawlen lua_strlen
#endif
class GetStackValueVisitor : public osg::ValueObject::SetValueVisitor
{