Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 10:45:56 PM (16 years ago)
Author:
rgrieder
Message:

Added FindLua.cmake:

  • Finds both version 5.0 and 5.1, but prefers 5.1
  • Regards version arguments (5.1.3 EXACT will only match 5.1.3, whereas 5 EXACT will match all Lua 5 versions)
  • Checks the header for the right version always
  • Also finds debug libraries

As you might know, there are already two scripts in the CMake module path: FindLua50.cmake and FindLua51.cmake. Unfortunately it would require writing a lot of hacky extra code to meet our needs with Lua versions. So I decided to write a whole new find script that should be able to all we need.

Location:
code/branches/buildsystem2/cmake
Files:
1 added
1 edited

Legend:

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

    r2612 r2615  
    2323FIND_PACKAGE(DirectX REQUIRED)
    2424
    25 # Require Lua 5.0 or 5.1
    26 FIND_PACKAGE(Lua50 QUIET)
    27 IF(NOT LUA50_FOUND)
    28   # Remove variables set by Lua50 and try with Lua51
    29   SET(LUA_INCLUDE_DIR)
    30   SET(LUA_LIBRARY_lua)
    31   SET(LUA_LIBRARY_lualib)
    32   SET(LUA_LIBRARIES)
    33   FIND_PACKAGE(Lua51 REQUIRED)
    34 ENDIF(NOT LUA50_FOUND)
    35 # Determine Lua version (Lua50 may also find Lua51)
    36 FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" LUA_VERSION REGEX "LUA_VERSION")
    37 STRING(REGEX REPLACE "^.*\"Lua (.*)\".*$" "\\1" LUA_VERSION "${LUA_VERSION}")
     25##### Lua #####
     26IF(CEGUILUA_USE_EXTERNAL_LIBRARY)
     27  COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)
     28  IF(version_comparison LESS 0)
     29    SET(LUA_VERSION_REQUEST 5.0)
     30  ELSE(version_comparison LESS 0)
     31    SET(LUA_VERSION_REQUEST 5.1)
     32  ENDIF(version_comparison LESS 0)
     33ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY)
     34  SET(LUA_VERSION_REQUEST 5)
     35ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY)
     36FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    3837
    3938# QUIET: Don't require the whole tcl rat tail
Note: See TracChangeset for help on using the changeset viewer.