aaaaand let's not forget about lua, which has also a slightly revised build process
authorkoda
Wed, 12 Jun 2013 01:26:42 +0200
changeset 9205 abce6011f86c
parent 9204 1c233176fffd
child 9206 4788b24fee05
aaaaand let's not forget about lua, which has also a slightly revised build process
CMakeLists.txt
hedgewars/LuaPas.pas
hedgewars/uScript.pas
misc/liblua/CMakeLists.txt
--- a/CMakeLists.txt	Wed Jun 12 01:04:30 2013 +0200
+++ b/CMakeLists.txt	Wed Jun 12 01:26:42 2013 +0200
@@ -141,8 +141,6 @@
 else()
     message(STATUS "LUA will be provided by the bundled sources")
     add_subdirectory(misc/liblua)
-    #linking with liblua.a requires system readline
-    list(APPEND pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline")
 endif()
 
 
--- a/hedgewars/LuaPas.pas	Wed Jun 12 01:04:30 2013 +0200
+++ b/hedgewars/LuaPas.pas	Wed Jun 12 01:26:42 2013 +0200
@@ -14,6 +14,9 @@
 uses uConsts;
 {.$DEFINE LUA_GETHOOK}
 
+{$INCLUDE "config.inc"}
+const LuaLibName = cLuaLibrary;
+
 type
     size_t   = Cardinal;
     Psize_t  = ^size_t;
@@ -22,9 +25,6 @@
     lua_State = record end;
     Plua_State = ^lua_State;
 
-{$DEFINE LuaLibName:= cLuaLibrary}
-
-
 (*****************************************************************************)
 (*                               luaconfig.h                                 *)
 (*****************************************************************************)
--- a/hedgewars/uScript.pas	Wed Jun 12 01:04:30 2013 +0200
+++ b/hedgewars/uScript.pas	Wed Jun 12 01:26:42 2013 +0200
@@ -54,6 +54,11 @@
 
 implementation
 {$IFDEF USE_LUA_SCRIPT}
+
+{$IFNDEF WIN32}
+    {$linklib lua}
+{$ENDIF}
+
 uses LuaPas,
     uConsole,
     uConsts,
--- a/misc/liblua/CMakeLists.txt	Wed Jun 12 01:04:30 2013 +0200
+++ b/misc/liblua/CMakeLists.txt	Wed Jun 12 01:26:42 2013 +0200
@@ -4,17 +4,22 @@
 
 if(WIN32)
     add_definitions(-DLUA_BUILD_AS_DLL)
-    add_library(lua SHARED ${lua_src})
-
-    set(LUA_LIBRARY lua.dll)
-
-    set_target_properties(lua PROPERTIES PREFIX "")
-    install(TARGETS lua RUNTIME DESTINATION ${target_library_install_dir})
 else(WIN32)
     add_definitions(-DLUA_USE_LINUX)
-    add_library(lua STATIC ${lua_src})
-    set(LUA_LIBRARY lua)
+    add_definitions(-fvisibility=default) #TODO: fixme
 endif(WIN32)
 
+add_library(lua ${lua_src})
+
+set_target_properties(lua PROPERTIES
+                          VERSION "5.1.4"
+                          SOVERSION 1)
+install(TARGETS lua RUNTIME DESTINATION ${target_binary_install_dir}
+                    LIBRARY DESTINATION ${target_library_install_dir}
+                    ARCHIVE DESTINATION ${target_library_install_dir})
+get_target_property(lua_fullpath lua LOCATION)
+
+set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "" FORCE)
+set(LUA_LIBRARY ${lua_fullpath} CACHE STRING "" FORCE)