Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7944


Ignore:
Timestamp:
Feb 21, 2011, 3:47:04 AM (14 years ago)
Author:
rgrieder
Message:

Renamed Lua library to "Lua5.1" because that's also what the official Linux repositories call it to differentiate it from Lua v5.0.
Also simplified the CMake find script a lot since it doesn't have to find both Lua versions anymore.

Location:
code/branches/kicklib
Files:
1 deleted
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/cmake/LibraryConfig.cmake

    r7943 r7944  
    9595FIND_PACKAGE(OGRE     1.4    REQUIRED)
    9696#FIND_PACKAGE(ENet     1.1    REQUIRED)
    97 FIND_PACKAGE(Lua      5.1    REQUIRED)
     97FIND_PACKAGE(Lua5.1          REQUIRED)
    9898FIND_PACKAGE(Ogg             REQUIRED)
    9999FIND_PACKAGE(Vorbis          REQUIRED)
     
    155155# Note: Default option in the libraries vary, but our default option is dynamic
    156156IF(WIN32)
    157   OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE)
    158   OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE)
    159   #OPTION(LINK_ENET_DYNAMIC  "Link ENet dynamically on Windows" TRUE)
    160   OPTION(LINK_OGRE_DYNAMIC  "Link OGRE dynamically on Windows" TRUE)
    161   OPTION(LINK_TCL_DYNAMIC   "Link TCL dynamically on Windows" TRUE)
    162   OPTION(LINK_ZLIB_DYNAMIC  "Link ZLib dynamically on Windows" TRUE)
    163   COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison)
    164   IF(_version_comparison LESS 0)
    165     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE)
    166   ELSE(_version_comparison LESS 0)
    167     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    168   ENDIF(_version_comparison LESS 0)
     157  OPTION(LINK_BOOST_DYNAMIC  "Link Boost dynamically on Windows" TRUE)
     158  OPTION(LINK_CEGUI_DYNAMIC  "Link CEGUI dynamicylly on Windows" TRUE)
     159  #OPTION(LINK_ENET_DYNAMIC   "Link ENet dynamically on Windows" TRUE)
     160  OPTION(LINK_OGRE_DYNAMIC   "Link OGRE dynamically on Windows" TRUE)
     161  OPTION(LINK_TCL_DYNAMIC    "Link TCL dynamically on Windows" TRUE)
     162  OPTION(LINK_ZLIB_DYNAMIC   "Link ZLib dynamically on Windows" TRUE)
     163  OPTION(LINK_LUA5.1_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    169164
    170165  IF(DEPENDENCY_PACKAGE_ENABLE)
     
    172167      LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC
    173168      LINK_OGRE_DYNAMIC  LINK_TCL_DYNAMIC   LINK_ZLIB_DYNAMIC
    174       LINK_LUA_DYNAMIC
     169      LINK_LUA5.1_DYNAMIC
    175170    )
    176171  ENDIF()
  • code/branches/kicklib/cmake/LibraryConfigTardis.cmake

    r6746 r7944  
    7777  #SET(ENV{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    7878  #SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    79   #SET(ENV{LUA_DIR}     "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
     79  #SET(ENV{LUA5.1_DIR}  "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
    8080  #SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")
    8181  #SET(ENV{OPENALDIR}   "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
  • code/branches/kicklib/cmake/PackageConfig.cmake

    r7459 r7944  
    8484SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
    8585#SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
    86 SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
     86SET(ENV{LUA5.1_DIR}            ${DEP_INCLUDE_DIR}/lua)
    8787SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
    8888SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
  • code/branches/kicklib/cmake/tools/FindLua5.1.cmake

    r7943 r7944  
    2121 #    Reto Grieder
    2222 #  Description:
    23  #    Finds either Lua 5.0 or Lua 5.1 on the system. The script regards the
    24  #    VERSION, EXACT, REQUIRED and QUIET arguments. A note about the EXACT
    25  #    argument: EXACT 5 will match all Lua 5 versions.
     23 #    Finds Lua 5.1 on the system.
     24 #    Handles REQUIRED and QUIET arguments.
    2625 #    When the search was successful, the following variables are set:
    27  #    LUA_INCLUDE_DIR, LUA_LIBRARIES, LUA_VERSION, LUA_FOUND
     26 #    LUA5.1_INCLUDE_DIR, LUA5.1_LIBRARY, LUA5.1_VERSION, LUA5.1_FOUND
    2827 #
    2928
     
    5554
    5655
    57 # Find Lua 5.1
    58 FIND_PATH(LUA_5.1_INCLUDE_DIR lua.h
     56# Find include path
     57FIND_PATH(LUA5.1_INCLUDE_DIR lua.h
    5958  PATHS $ENV{LUA_DIR}
    6059  PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
    6160)
    62 IF(LUA_5.1_INCLUDE_DIR)
    63   DETERMINE_LUA_VERSION(${LUA_5.1_INCLUDE_DIR}/lua.h LUA_5.1_VERSION)
    64   COMPARE_VERSION_STRINGS("${LUA_5.1_VERSION}" "5.1" _version_compare TRUE)
     61
     62# Check whether we really found Lua version 5.1
     63IF(LUA5.1_INCLUDE_DIR)
     64  DETERMINE_LUA_VERSION(${LUA5.1_INCLUDE_DIR}/lua.h LUA5.1_VERSION)
     65  COMPARE_VERSION_STRINGS("${LUA5.1_VERSION}" "5.1" _version_compare TRUE)
    6566  IF(NOT _version_compare EQUAL 0)
    66     # Incorrect version found, abort search
    67     SET(LUA_5.1_INCLUDE_DIR "LUA_5.1_INCLUDE_DIR-NOTFOUND" CACHE PATH "" FORCE)
    68   ELSE()
    69     FIND_LIBRARY(LUA_5.1_LIBRARY_OPTIMIZED
    70       NAMES lua51 lua5.1 lua
    71       PATHS $ENV{LUA_DIR}
    72       PATH_SUFFIXES lib64 lib
    73     )
    74     FIND_LIBRARY(LUA_5.1_LIBRARY_DEBUG
    75       NAMES lua51d lua51_d lua5.1d lua5.1_d luad lua_d
    76             lua51D lua51_D lua5.1D lua5.1_D luad lua_D
    77       PATHS $ENV{LUA_DIR}
    78       PATH_SUFFIXES lib64 lib
    79     )
    80     HANDLE_LIBRARY_TYPES(LUA_5.1)
    81     SET(LUA_5.1_LIBRARIES ${LUA_5.1_LIBRARY})
    82     IF(LUA_5.1_LIBRARIES)
    83       SET(LUA_5.1_FOUND TRUE)
    84     ENDIF()
     67    # Wrong version
     68    SET(LUA5.1_INCLUDE_DIR "LUA5.1_INCLUDE_DIR-NOTFOUND" CACHE PATH "" FORCE)
    8569  ENDIF(NOT _version_compare EQUAL 0)
    86 ENDIF(LUA_5.1_INCLUDE_DIR)
     70ENDIF(LUA5.1_INCLUDE_DIR)
    8771
    88 
    89 # Find Lua 5.0
    90 FIND_PATH(LUA_5.0_INCLUDE_DIR lua.h
    91   PATHS $ENV{LUA_DIR}
    92   PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
     72# Find library
     73FIND_LIBRARY(LUA5.1_LIBRARY_OPTIMIZED
     74  NAMES lua51 lua5.1 lua
     75  PATHS $ENV{LUA5.1_DIR} $ENV{LUA_DIR}
     76  PATH_SUFFIXES lib64 lib
    9377)
    94 IF(LUA_5.0_INCLUDE_DIR)
    95   DETERMINE_LUA_VERSION(${LUA_5.0_INCLUDE_DIR}/lua.h LUA_5.0_VERSION)
    96   COMPARE_VERSION_STRINGS("${LUA_5.0_VERSION}" "5.0" _version_compare TRUE)
    97   IF(NOT _version_compare EQUAL 0)
    98     # Incorrect version found, abourt search
    99     SET(LUA_5.0_INCLUDE_DIR "LUA_5.0_INCLUDE_DIR-NOTFOUND" CACHE PATH "" FORCE)
    100   ELSE()
    101     FIND_LIBRARY(LUA_5.0_LUA_LIBRARY_OPTIMIZED
    102       NAMES lua50 lua5.0 lua5 lua
    103       PATHS $ENV{LUA_DIR}
    104       PATH_SUFFIXES lib64 lib
    105     )
    106     FIND_LIBRARY(LUA_5.0_LUA_LIBRARY_DEBUG
    107       NAMES lua50d lua50_d lua5.0d lua5.0_d lua5d lua5_d luad lua_d
    108             lua50D lua50_D lua5.0D lua5.0_D lua5d lua5_D luaD lua_D
    109       PATHS $ENV{LUA_DIR}
    110       PATH_SUFFIXES lib64 lib
    111     )
    112     HANDLE_LIBRARY_TYPES(LUA_5.0_LUA)
    113 
    114     # In an OS X framework, lualib is usually included as part of the framework
    115     # (like GLU in OpenGL.framework)
    116     IF(${LUA_5.0_LUA_LIBRARY} MATCHES "framework")
    117       SET(LUA_5.0_LIBRARIES ${LUA_5.0_LUA_LIBRARY})
    118     ELSE()
    119       FIND_LIBRARY(LUA_5.0_LUALIB_LIBRARY_OPTIMIZED
    120         NAMES lualib50 lualib5.0 lualib5 lualib
    121         PATHS $ENV{LUALIB_DIR} $ENV{LUA_DIR}
    122         PATH_SUFFIXES lib64 lib
    123       )
    124       FIND_LIBRARY(LUA_5.0_LUALIB_LIBRARY_DEBUG
    125         NAMES lualib50d lualib50_d lualib5.0d lualib5.0_d
    126               lualib5d lualib5_d lualibd lualib_d
    127               lualib50D lualib50_D lualib5.0D lualib5.0_D
    128               lualib5D lualib5_D lualibD lualib_D
    129         PATHS $ENV{LUALIB_DIR} $ENV{LUA_DIR}
    130         PATH_SUFFIXES lib64 lib
    131       )
    132       HANDLE_LIBRARY_TYPES(LUA_5.0_LUALIB)
    133       # Both libraries are required for Lua 5.0 to be found
    134       IF(LUA_5.0_LUA_LIBRARY AND LUA_5.0_LUALIB_LIBRARY)
    135         SET(LUA_5.0_LIBRARIES ${LUA_5.0_LUA_LIBRARY} ${LUA_5.0_LUALIB_LIBRARY})
    136       ENDIF()
    137     ENDIF(${LUA_5.0_LUA_LIBRARY} MATCHES "framework")
    138 
    139     IF(LUA_5.0_LIBRARIES)
    140       SET(LUA_5.0_FOUND TRUE)
    141     ENDIF()
    142   ENDIF(NOT _version_compare EQUAL 0)
    143 ENDIF(LUA_5.0_INCLUDE_DIR)
    144 
    145 # Pick the right version
    146 IF(Lua_FIND_VERSION_EXACT AND NOT Lua_FIND_VERSION MATCHES "^[0-9]*$")
    147   STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+)(\\..*)?$" "\\1" LUA_VERSION_SELECTION ${Lua_FIND_VERSION})
    148 ELSE()
    149   IF(LUA_5.1_FOUND) # Prefer version 5.1 if found
    150     SET(LUA_VERSION_SELECTION "5.1")
    151   ELSEIF(LUA_5.0_FOUND)
    152     SET(LUA_VERSION_SELECTION "5.0")
    153   ENDIF()
    154 ENDIF()
    155 
    156 SET(LUA_INCLUDE_DIR "${LUA_${LUA_VERSION_SELECTION}_INCLUDE_DIR}")
    157 SET(LUA_LIBRARIES "${LUA_${LUA_VERSION_SELECTION}_LIBRARIES}")
    158 SET(LUA_VERSION_LONG "${LUA_${LUA_VERSION_SELECTION}_VERSION}")
    159 SET(LUA_VERSION "${LUA_VERSION_SELECTION}")
    160 
    161 FIND_PACKAGE_HANDLE_ADVANCED_ARGS(Lua DEFAULT_MSG "${LUA_VERSION_LONG}"
    162   LUA_LIBRARIES
    163   LUA_INCLUDE_DIR
     78FIND_LIBRARY(LUA5.1_LIBRARY_DEBUG
     79  NAMES lua51d lua51_d lua5.1d lua5.1_d
     80        lua51D lua51_D lua5.1D lua5.1_D
     81        luad lua_d luad lua_D
     82  PATHS $ENV{LUA5.1_DIR} $ENV{LUA_DIR}
     83  PATH_SUFFIXES lib64 lib
    16484)
    16585
    166 # Include the math library for Unix only
    167 IF(LUA_FOUND)
    168   IF(UNIX AND NOT APPLE)
    169     FIND_LIBRARY(UNIX_MATH_LIBRARY m)
    170     SET(LUA_LIBRARIES ${LUA_LIBRARIES} ${UNIX_MATH_LIBRARY})
    171   ENDIF()
    172 ENDIF(LUA_FOUND)
     86# Handle the REQUIRED argument and set LUA5.1_FOUND
     87FIND_PACKAGE_HANDLE_ADVANCED_ARGS(Lua5.1 DEFAULT_MSG
     88  LUA5.1_LIBRARY
     89  LUA5.1_INCLUDE_DIR
     90)
     91
     92# Collect optimized and debug libraries
     93HANDLE_LIBRARY_TYPES(LUA5.1)
    17394
    17495MARK_AS_ADVANCED(
    175   LUA_5.0_INCLUDE_DIR
    176   LUA_5.0_LUA_LIBRARY_OPTIMIZED
    177   LUA_5.0_LUA_LIBRARY_DEBUG
    178   LUA_5.0_LUALIB_LIBRARY_OPTIMIZED
    179   LUA_5.0_LUALIB_LIBRARY_DEBUG
    180   LUA_5.1_INCLUDE_DIR
    181   LUA_5.1_LIBRARY_OPTIMIZED
    182   LUA_5.1_LIBRARY_DEBUG
    183   UNIX_MATH_LIBRARY
     96  LUA5.1_INCLUDE_DIR
     97  LUA5.1_LIBRARY_OPTIMIZED
     98  LUA5.1_LIBRARY_DEBUG
    18499)
  • code/branches/kicklib/src/CMakeLists.txt

    r7941 r7944  
    3939ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
    4040#ADD_COMPILER_FLAGS("-DENET_DLL"           WIN32 LINK_ENET_DYNAMIC)
    41 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
     41ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA5.1_DYNAMIC)
    4242ADD_COMPILER_FLAGS("-DZLIB_DLL"           WIN32 LINK_ZLIB_DYNAMIC)
    4343# If no defines are specified, these libs get linked dynamically
     
    7878  ${VORBIS_INCLUDE_DIR}
    7979  ${OGG_INCLUDE_DIR}
    80   ${LUA_INCLUDE_DIR}
     80  ${LUA5.1_INCLUDE_DIR}
    8181  ${TCL_INCLUDE_PATH}
    8282  ${DIRECTX_INCLUDE_DIR}
  • code/branches/kicklib/src/external/tolua/CMakeLists.txt

    r7941 r7944  
    2626  NO_INSTALL
    2727  LINK_LIBRARIES
    28     ${LUA_LIBRARIES}
     28    ${LUA5.1_LIBRARY}
    2929  SOURCE_FILES
    3030    tolua.c
     
    3232
    3333# Set some variables to the cache in order to use them in the TOLUA macro
    34 SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/all-${LUA_VERSION}.lua" CACHE INTERNAL "")
     34SET(TOLUA_PARSER_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua" CACHE INTERNAL "")
    3535SET(TOLUA_PARSER_DEPENDENCIES
    3636  toluaapp_orxonox
    37   ${CMAKE_CURRENT_SOURCE_DIR}/all-${LUA_VERSION}.lua
     37  ${CMAKE_CURRENT_SOURCE_DIR}/all-5.1.lua
    3838  ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat-5.1.lua
    3939  ${CMAKE_CURRENT_SOURCE_DIR}/lua/compat.lua
  • code/branches/kicklib/src/libraries/core/CMakeLists.txt

    r7941 r7944  
    9494    ${CEGUILUA_LIBRARY}
    9595    ${CEGUI_TOLUA_LIBRARY}
    96     ${LUA_LIBRARIES}
     96    ${LUA5.1_LIBRARY}
    9797    cpptcl_orxonox
    9898    ogreceguirenderer_orxonox
Note: See TracChangeset for help on using the changeset viewer.