Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2608


Ignore:
Timestamp:
Jan 29, 2009, 8:13:22 PM (15 years ago)
Author:
rgrieder
Message:

Large cleanup in CEGUILua:

  • Removed the heavy 1.7MB bind files and added the small pkg files from the CEGUI source instead
  • Those pkg files get copied version incrementally (starting with 0.5.0) to the binary dir. That saves a lot of files when having 4 different versions.
  • Added support for CEGUI 0.6.0 and 0.6.2
  • Added library info files
  • CEGUILua 0.5.0 finally supports Lua 5.1 too That means all version support both Lua 5.0 and 5.1
  • Added unified diffs with the changes to the CEGUILua source
Location:
code/branches/buildsystem2/src
Files:
130 added
4 deleted
8 edited
1 copied
2 moved

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/src/CMakeLists.txt

    r2593 r2608  
    1616
    1717# Check whether the required CEGUILua version is even available
    18 IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION})
     18IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
    1919  MESSAGE(FATAL_ERROR "No matching CEGUILua version shipped with Orxonox (${CEGUI_VERSION})")
    20 ENDIF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION})
     20ENDIF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
    2121
    2222INCLUDE_DIRECTORIES(
    23   ceguilua-${CEGUI_VERSION}/ceguilua
     23  ceguilua/ceguilua-${CEGUI_VERSION}/ceguilua
    2424  cpptcl
    2525  ois
     
    4545
    4646# External libraries, but copied into the repository
    47 ADD_SUBDIRECTORY(ceguilua-${CEGUI_VERSION}/ceguilua)
     47ADD_SUBDIRECTORY(ceguilua)
    4848ADD_SUBDIRECTORY(cpptcl)
    4949ADD_SUBDIRECTORY(ogreceguirenderer)
  • code/branches/buildsystem2/src/ceguilua/CMakeLists.txt

    r2604 r2608  
    1 SET( CEGUILUA_SRC_FILES
    2   CEGUILua.cpp
    3   CEGUILuaFunctor.cpp
    4   lua_CEGUI.cpp
    5   required.cpp
     1SET(CEGUILUA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION}/ceguilua)
     2SET(CEGUILUA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
     3
     4SET(CEGUILUA_FILES
     5  ${CEGUILUA_DIR}/CEGUILua.cpp
     6  ${CEGUILUA_DIR}/CEGUILuaFunctor.cpp
     7  ${CEGUILUA_DIR}/required.cpp
     8  ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp
     9
     10  ${CEGUILUA_DIR}/CEGUILua.h
     11  ${CEGUILUA_DIR}/CEGUILuaFunctor.h
     12  ${CEGUILUA_DIR}/required.h
    613)
    714
    8 ADD_CXX_FLAGS("-wd4996" MSVC)
     15INCLUDE(CompareVersionStrings)
    916
    10 ADD_LIBRARY( ceguilua_orxonox SHARED ${CEGUILUA_SRC_FILES} )
     17# Copy package files incrementally until the version is met
     18SET(CEGUILUA_VERSIONS 0.5.0 0.6.0 0.6.1 0.6.2)
     19FOREACH(_version ${CEGUILUA_VERSIONS})
     20  COMPARE_VERSION_STRINGS(${_version} ${CEGUI_VERSION} _compare_result)
     21  IF(_compare_result EQUAL 1)
     22    BREAK() # _version > CEGUI_VERSION
     23  ENDIF(_compare_result EQUAL 1)
     24  ADD_SUBDIRECTORY(ceguilua-${_version})
     25ENDFOREACH(_version)
    1126
     27# Create the tolua bind file. We could use the orignal file though, but it is 1.6MB...
     28ADD_CUSTOM_COMMAND(
     29  OUTPUT ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp
     30  COMMAND toluaexe_orxonox -n CEGUI
     31                             -w ${CEGUILUA_BINARY_DIR}
     32                             -o lua_CEGUI.cpp
     33                             -L exceptions.lua
     34                             -s ${TOLUA_PARSER_SOURCE}
     35                                CEGUI.pkg
     36  DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
     37  WORKING_DIRECTORY    ${ORXONOX_LIBRARY_BIN_DIR}
     38  COMMENT "Generating tolua bind files for package CEGUILua"
     39)
     40
     41ADD_CXX_FLAGS("-w44996" MSVC)
     42
     43ADD_LIBRARY(ceguilua_orxonox SHARED ${CEGUILUA_FILES})
    1244SET_TARGET_PROPERTIES(ceguilua_orxonox PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS")
    1345TARGET_LINK_LIBRARIES(ceguilua_orxonox
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.5.0/ceguilua/CEGUILua.cpp

    r2509 r2608  
    4141}
    4242
    43 #include "tolua++.h"
     43#include "tolua/tolua++.h"
    4444
    4545// prototype for bindings initialisation function
     
    5656LuaScriptModule::LuaScriptModule()
    5757{
     58    #if LUA_VERSION_NUM >= 501
     59        static const luaL_Reg lualibs[] = {
     60            {"", luaopen_base},
     61            {LUA_LOADLIBNAME, luaopen_package},
     62            {LUA_TABLIBNAME, luaopen_table},
     63            {LUA_IOLIBNAME, luaopen_io},
     64            {LUA_OSLIBNAME, luaopen_os},
     65            {LUA_STRLIBNAME, luaopen_string},
     66            {LUA_MATHLIBNAME, luaopen_math},
     67        #if defined(DEBUG) || defined (_DEBUG)
     68                {LUA_DBLIBNAME, luaopen_debug},
     69        #endif
     70            {0, 0}
     71        };
     72    #endif /* LUA_VERSION_NUM >= 501 */
     73
    5874        // create a lua state
    5975        d_ownsState = true;
     
    6177
    6278        // init all standard libraries
    63         luaopen_base(d_state);
    64         luaopen_io(d_state);
    65         luaopen_string(d_state);
    66         luaopen_table(d_state);
    67         luaopen_math(d_state);
    68 #if defined(DEBUG) || defined (_DEBUG)
    69         luaopen_debug(d_state);
    70 #endif
     79    #if LUA_VERSION_NUM >= 501
     80            const luaL_Reg *lib = lualibs;
     81            for (; lib->func; lib++)
     82            {
     83                lua_pushcfunction(d_state, lib->func);
     84                lua_pushstring(d_state, lib->name);
     85                lua_call(d_state, 1, 0);
     86            }
     87    #else /* LUA_VERSION_NUM >= 501 */
     88            luaopen_base(d_state);
     89            luaopen_io(d_state);
     90            luaopen_string(d_state);
     91            luaopen_table(d_state);
     92            luaopen_math(d_state);
     93        #if defined(DEBUG) || defined (_DEBUG)
     94                luaopen_debug(d_state);
     95        #endif
     96    #endif /* LUA_VERSION_NUM >= 501 */
    7197
    7298        setModuleIdentifierString();
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.5.0/ceguilua/CEGUILua.h

    r2509 r2608  
    3232
    3333
    34 /*** CHANGES BY ORXONOX TEAM FOR MINGW32 ***/
    3534/*************************************************************************
    3635        Import / Export control macros
    3736*************************************************************************/
    38 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
     37#if defined( __WIN32__ ) || defined( _WIN32 )
    3938#   ifdef CEGUILUA_EXPORTS
    4039#       define CEGUILUA_API __declspec(dllexport)
    4140#   else
    42 #      if defined( __MINGW32__ )
    43 #          define CEGUILUA_API
    44 #      else
    45 #          define CEGUILUA_API __declspec(dllimport)
    46 #      endif
     41#       if defined( __MINGW32__ )
     42#           define CEGUILUA_API
     43#       else
     44#           define CEGUILUA_API __declspec(dllimport)
     45#       endif
    4746#   endif
    4847#else
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.5.0/ceguilua/CEGUILuaFunctor.cpp

    r2509 r2608  
    4040}
    4141
    42 #include "tolua++.h"
     42#include "tolua/tolua++.h"
    4343
    4444// Start of CEGUI namespace section
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.5.0/ceguilua/required.h

    r2509 r2608  
    3636#define __operator_decrement    operator--
    3737#define __operator_dereference  operator*
     38
     39//This is used to keep compilers happy
     40#define CEGUIDeadException(e) &
    3841
    3942#define LuaFunctorSubscribeEvent CEGUI::LuaFunctor::SubscribeEvent
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.6.1/ceguilua/CEGUILua.cpp

    r2509 r2608  
    2828 *   OTHER DEALINGS IN THE SOFTWARE.
    2929 ***************************************************************************/
    30 #ifdef HAVE_CONFIG_H
    31 #   include "config.h"
    32 #endif
    33 
    3430#include "CEGUI.h"
    3531#include "CEGUIConfig.h"
     
    4642}
    4743
    48 #include "tolua++.h"
     44#include "tolua/tolua++.h"
    4945
    5046// prototype for bindings initialisation function
     
    7571            {0, 0}
    7672        };
    77     #endif /* CEGUI_LUA_VER >= 51 */
     73    #endif /* LUA_VERSION_NUM >= 501 */
    7874
    7975    // create a lua state
     
    9086                lua_call(d_state, 1, 0);
    9187            }
    92     #else /* CEGUI_LUA_VER >= 51 */
     88    #else /* LUA_VERSION_NUM >= 501 */
    9389        luaopen_base(d_state);
    9490        luaopen_io(d_state);
     
    9995            luaopen_debug(d_state);
    10096        #endif
    101     #endif /* CEGUI_LUA_VER >= 51 */
     97    #endif /* LUA_VERSION_NUM >= 501 */
    10298
    10399    setModuleIdentifierString();
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.6.1/ceguilua/CEGUILua.h

    r1848 r2608  
    3131#define _CEGUILua_h_
    3232
    33 /*** CHANGES BY ORXONOX TEAM FOR MINGW32 ***/
     33
    3434/*************************************************************************
    3535        Import / Export control macros
     
    3939#       define CEGUILUA_API __declspec(dllexport)
    4040#   else
    41 #      if defined( __MINGW32__ )
    42 #          define CEGUILUA_API
    43 #      else
    44 #          define CEGUILUA_API __declspec(dllimport)
    45 #      endif
     41#       if defined( __MINGW32__ )
     42#           define CEGUILUA_API
     43#       else
     44#           define CEGUILUA_API __declspec(dllimport)
     45#       endif
    4646#   endif
    4747#else
  • code/branches/buildsystem2/src/ceguilua/ceguilua-0.6.1/ceguilua/CEGUILuaFunctor.cpp

    r2509 r2608  
    4040}
    4141
    42 #include "tolua++.h"
     42#include "tolua/tolua++.h"
    4343
    4444// Start of CEGUI namespace section
Note: See TracChangeset for help on using the changeset viewer.