From cb14492ccde24443b69974b8b2af5221ac934961 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 1 Jul 2012 22:31:14 +0200 Subject: [PATCH] make cmake find the best Lua version that's installed --- src/CMakeLists.txt | 2 +- src/bindings/CMakeLists.txt | 2 +- src/bindings/bindings.c | 30 ------------------------------ 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 99c318a95..633509d2d 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,7 @@ set (ERESSEA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "Eressea Cor add_subdirectory(bindings) -find_package (Lua52 REQUIRED) +find_package (Lua 5 REQUIRED) find_package (ToLua REQUIRED) find_package (LibXml2 REQUIRED) find_package (Curses REQUIRED) diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt index f3945b4f5..56310c2d3 100755 --- a/src/bindings/CMakeLists.txt +++ b/src/bindings/CMakeLists.txt @@ -9,7 +9,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) set (BINDINGS_LIBRARY ${PROJECT_NAME} CACHE INTERNAL "Eressea Lua Bindings") -find_package (Lua52 REQUIRED) +find_package (Lua 5 REQUIRED) find_package (ToLua REQUIRED) find_package (LibXml2 REQUIRED) find_package (Curses REQUIRED) diff --git a/src/bindings/bindings.c b/src/bindings/bindings.c index 23f90cd8a..904e3e015 100755 --- a/src/bindings/bindings.c +++ b/src/bindings/bindings.c @@ -1160,39 +1160,9 @@ int tolua_bindings_open(lua_State * L) return 1; } -static const struct { - const char *name; - int (*func) (lua_State *); -} lualibs[] = { - { - "", luaopen_base}, { - LUA_TABLIBNAME, luaopen_table}, { - LUA_IOLIBNAME, luaopen_io}, { - LUA_STRLIBNAME, luaopen_string}, { - LUA_MATHLIBNAME, luaopen_math}, { - LUA_LOADLIBNAME, luaopen_package}, { - LUA_DBLIBNAME, luaopen_debug}, -#if LUA_VERSION_NUM>=501 - { - LUA_OSLIBNAME, luaopen_os}, -#endif - { - NULL, NULL} -}; - static void openlibs(lua_State * L) { luaL_openlibs(L); -/* int i, err; - for (i = 0; lualibs[i].func; ++i) { - lua_pushcfunction(L, lualibs[i].func); - lua_pushstring(L, lualibs[i].name); - err = lua_pcall(L, 1, 0, 0); - if (err != 0) { - log_lua_error(L); - } - } -*/ } void lua_done(lua_State * L) {