Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindLua.cmake @ 1193

Last change on this file since 1193 was 1153, checked in by rgrieder, 17 years ago
  • merged cmake branch back to trunk (the last one, hopefully ;))
  • added Oli's lua library name (liblua.so)
File size: 2.1 KB
RevLine 
[1126]1#  Find Lua header and library files
[946]2#
[1126]3#  When called, this script tries to define:
4#  Lua_INCLUDE_DIR    Header files directory
5#  Lua_LIBRARIES      library files (or file when using lua 5.1)
6#  Lua_FOUND          defined (true) if lua was found
7#  Lua_VERSION        either 5.1 or 5.0 or undefined
[946]8#
[1126]9#  authors: Benjamin Knecht, Reto Grieder
[1037]10
[946]11IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
[1037]12
[1126]13  # Already in cache, be silent
14  SET(Lua_FOUND TRUE)
15  SET(Lua_FIND_QUIETLY TRUE) 
16  MESSAGE(STATUS "Lua was found.")
[1037]17
[1126]18ELSE (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
[1037]19
[1126]20  FIND_PATH(Lua_INCLUDE_DIR_51 lua.h
21    /usr/include/lua5.1
22    /usr/local/include/lua5.1
23    ../libs/lua-5.1.3/src)
[1037]24
[1126]25  FIND_PATH(Lua_INCLUDE_DIR_50 lua.h
26    /usr/include/lua50
27    /usr/local/include/lua50
28    /usr/pack/lua-5.0.3-sd/include)
[1037]29
[1153]30  FIND_LIBRARY(Lua_LIBRARY_51 NAMES lua5.1 lua PATHS
[1126]31    /usr/lib
32    /usr/local/lib
33    ../libs/lua-5.1.3/lib)
[1037]34
[1126]35  FIND_LIBRARY(Lua_LIBRARY_1_50 NAMES lua50 lua PATHS
36        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
37    /usr/lib
38    /usr/local/lib)
[1037]39
[1126]40  FIND_LIBRARY(Lua_LIBRARY_2_50 NAMES lualib50 lualib PATHS
41        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib #tardis
42    /usr/lib
43    /usr/local/lib)
[1037]44
45
[1126]46  IF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
[1037]47
[1126]48    # Found newer lua 5.1 libs
[946]49    SET(Lua_FOUND TRUE)
[1126]50    SET(Lua_VERSION 5.1 CACHE STRING "")
51    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_51} CACHE PATH "")
52    SET(Lua_LIBRARIES ${Lua_LIBRARY_51} CACHE FILEPATH "")
[946]53
[1126]54  ELSEIF(Lua_INCLUDE_DIR_50 AND Lua_LIBRARY_1_50 AND Lua_LIBRARY_2_50)
55
56    # Found older lua 5.0 libs
57    SET(Lua_FOUND TRUE)
58    SET(Lua_VERSION 5.0 CACHE STRING "")
59    SET(Lua_INCLUDE_DIR ${Lua_INCLUDE_DIR_50} CACHE PATH "")
60    SET(Lua_LIBRARIES ${Lua_LIBRARY_1_50} ${Lua_LIBRARY_2_50} CACHE FILEPATH "")
61
62  ENDIF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
63       
64
65  IF (Lua_FOUND)
[946]66    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
[1126]67  ELSE (Lua_FOUND)
[946]68    IF (Lua_FIND_REQUIRED)
[1126]69      MESSAGE(FATAL_ERROR "Could not find Lua")
[946]70    ENDIF (Lua_FIND_REQUIRED)
[1126]71  ENDIF (Lua_FOUND)
72
73ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
74
Note: See TracBrowser for help on using the repository browser.