Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/camera/cmake/FindLua.cmake @ 1276

Last change on this file since 1276 was 1211, checked in by scheusso, 17 years ago

merged trunk changes from 1101 to 1202 into camera branch

File size: 2.1 KB
RevLine 
[1211]1#  Find Lua header and library files
[946]2#
[1211]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#
[1211]9#  authors: Benjamin Knecht, Reto Grieder
[1037]10
[946]11IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
[1037]12
[1211]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
[1211]18ELSE (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
[1037]19
[1211]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
[1211]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
[1211]30  FIND_LIBRARY(Lua_LIBRARY_51 NAMES lua5.1 lua PATHS
31    /usr/lib
32    /usr/local/lib
33    ../libs/lua-5.1.3/lib)
[1037]34
[1211]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
[1211]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
[1211]46  IF (Lua_INCLUDE_DIR_51 AND Lua_LIBRARY_51)
[1037]47
[1211]48    # Found newer lua 5.1 libs
[946]49    SET(Lua_FOUND TRUE)
[1211]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
[1211]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}")
[1211]67  ELSE (Lua_FOUND)
[946]68    IF (Lua_FIND_REQUIRED)
[1211]69      MESSAGE(FATAL_ERROR "Could not find Lua")
[946]70    ENDIF (Lua_FIND_REQUIRED)
[1211]71  ENDIF (Lua_FOUND)
72
73ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
74
Note: See TracBrowser for help on using the repository browser.