diff --git a/CMakeLists.txt b/CMakeLists.txt index 3242edc68..47ef3f4b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/src/osgPlugins/lua/LuaScriptEngine.cpp b/src/osgPlugins/lua/LuaScriptEngine.cpp index 9fe8d363e..0c8172171 100644 --- a/src/osgPlugins/lua/LuaScriptEngine.cpp +++ b/src/osgPlugins/lua/LuaScriptEngine.cpp @@ -17,8 +17,6 @@ using namespace lua; -#define USE_USERDATA_FOR_POINTER 1 - static int getProperty(lua_State * _lua) { const LuaScriptEngine* lse = reinterpret_cast(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 {