make cmake find the best Lua version that's installed

This commit is contained in:
Enno Rehling 2012-07-01 22:31:14 +02:00
parent 3cee3d1415
commit cb14492ccd
3 changed files with 2 additions and 32 deletions

View File

@ -13,7 +13,7 @@ set (ERESSEA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "Eressea Cor
add_subdirectory(bindings) add_subdirectory(bindings)
find_package (Lua52 REQUIRED) find_package (Lua 5 REQUIRED)
find_package (ToLua REQUIRED) find_package (ToLua REQUIRED)
find_package (LibXml2 REQUIRED) find_package (LibXml2 REQUIRED)
find_package (Curses REQUIRED) find_package (Curses REQUIRED)

View File

@ -9,7 +9,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC)
set (BINDINGS_LIBRARY ${PROJECT_NAME} CACHE INTERNAL "Eressea Lua Bindings") 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 (ToLua REQUIRED)
find_package (LibXml2 REQUIRED) find_package (LibXml2 REQUIRED)
find_package (Curses REQUIRED) find_package (Curses REQUIRED)

View File

@ -1160,39 +1160,9 @@ int tolua_bindings_open(lua_State * L)
return 1; 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) static void openlibs(lua_State * L)
{ {
luaL_openlibs(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) { void lua_done(lua_State * L) {