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 | |
---|
13 | IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) |
---|
14 | SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
15 | ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) |
---|
16 | |
---|
17 | FIND_PATH(Lua_INCLUDE_DIR lua.h |
---|
18 | /usr/include/lua5.1 |
---|
19 | /usr/local/include/lua5.1) |
---|
20 | |
---|
21 | FIND_LIBRARY(Lua_LIBRARIES lua5.1 |
---|
22 | /usr/lib |
---|
23 | /usr/local/lib) |
---|
24 | |
---|
25 | IF (NOT Lua_INCLUDE_DIR) |
---|
26 | FIND_PATH(Lua_INCLUDE_DIR lua.h |
---|
27 | /usr/include/lua50 |
---|
28 | /usr/local/include/lua50 |
---|
29 | /usr/pack/lua-5.0.3-sd/include/) |
---|
30 | ENDIF (NOT Lua_INCLUDE_DIR) |
---|
31 | MESSAGE(STATUS ${Lua_INCLUDE_DIR}) |
---|
32 | |
---|
33 | IF (NOT Lua_LIBRARIES) |
---|
34 | FIND_LIBRARY(Lua_LIBRARIES lua50 lua |
---|
35 | /usr/lib |
---|
36 | /usr/local/lib |
---|
37 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/) |
---|
38 | |
---|
39 | FIND_LIBRARY(Lua_LIBRARY lualib50 lualib |
---|
40 | /usr/lib |
---|
41 | /usr/local/lib |
---|
42 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/) |
---|
43 | |
---|
44 | MESSAGE(STATUS ${Lua_LIBRARY}) |
---|
45 | MESSAGE(STATUS ${Lua_LIBRARIES}) |
---|
46 | |
---|
47 | SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY}) |
---|
48 | |
---|
49 | ENDIF (NOT Lua_LIBRARIES) |
---|
50 | |
---|
51 | IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
52 | SET(Lua_FOUND TRUE) |
---|
53 | ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
54 | |
---|
55 | IF (Lua_FOUND) |
---|
56 | MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}") |
---|
57 | ELSE (Lua_FOUND) |
---|
58 | IF (Lua_FIND_REQUIRED) |
---|
59 | MESSAGE(FATAL_ERROR "Could not find Lua") |
---|
60 | ENDIF (Lua_FIND_REQUIRED) |
---|
61 | ENDIF (Lua_FOUND) |
---|