Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 1062 was 1037, checked in by landauf, 17 years ago

moved tolua from util to core because of circular dependencies
reverted some bugfixes in ParticleInterface

File size: 1.7 KB
Line 
1# Find Lua includes and library
2#
3# This module defines
4#  Lua_INCLUDE_DIR
5#  Lua_LIBRARIES, the libraries to link against to use Lua.
6#  Lua_LIB_DIR, the location of the libraries
7#  Lua_FOUND, If false, do not try to use Lua
8#
9# Copyright © 2007, Matt Williams
10#
11# Redistribution and use is allowed according to the terms of the BSD license.
12
13IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
14    SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent
15ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR)
16
17FIND_PATH(Lua_INCLUDE_DIR lua.h
18        /usr/include/lua5.1
19        /usr/local/include/lua5.1
20        ../libs/lua-5.1.3/src)
21
22FIND_LIBRARY(Lua_LIBRARIES lua5.1
23        /usr/lib
24        /usr/local/lib
25        ../libs/lua-5.1.3/lib)
26
27IF (NOT Lua_INCLUDE_DIR)
28FIND_PATH(Lua_INCLUDE_DIR lua.h
29        /usr/include/lua50
30        /usr/local/include/lua50
31        /usr/pack/lua-5.0.3-sd/include)
32ENDIF (NOT Lua_INCLUDE_DIR)
33
34IF (NOT Lua_LIBRARIES)
35FIND_LIBRARY(Lua_LIBRARIES lua50
36        /usr/lib
37        /usr/local/lib)
38
39FIND_LIBRARY(Lua_LIBRARY lualib50
40        /usr/lib
41        /usr/local/lib)
42
43SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
44
45ENDIF (NOT Lua_LIBRARIES)
46
47IF (NOT Lua_LIBRARIES)
48FIND_LIBRARY(Lua_LIBRARIES lua
49        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
50
51FIND_LIBRARY(Lua_LIBRARY lualib
52        /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib)
53
54SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY})
55
56ENDIF (NOT Lua_LIBRARIES)
57
58IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
59    SET(Lua_FOUND TRUE)
60ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES)
61
62IF (Lua_FOUND)
63    MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}")
64ELSE (Lua_FOUND)
65    IF (Lua_FIND_REQUIRED)
66        MESSAGE(FATAL_ERROR "Could not find Lua")
67    ENDIF (Lua_FIND_REQUIRED)
68ENDIF (Lua_FOUND)
Note: See TracBrowser for help on using the repository browser.