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_LIBRARIES AND 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 | |
---|
31 | FIND_LIBRARY(Lua_LIBRARIES lua50 |
---|
32 | /usr/lib |
---|
33 | /usr/local/lib |
---|
34 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/) |
---|
35 | |
---|
36 | FIND_LIBRARY(Lua_LIBRARY lualib50 |
---|
37 | /usr/lib |
---|
38 | /usr/local/lib |
---|
39 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib/) |
---|
40 | |
---|
41 | SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY}) |
---|
42 | |
---|
43 | ENDIF (NOT Lua_LIBRARIES AND Lua_INCLUDE_DIR) |
---|
44 | |
---|
45 | IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
46 | SET(Lua_FOUND TRUE) |
---|
47 | ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
48 | |
---|
49 | IF (Lua_FOUND) |
---|
50 | MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}") |
---|
51 | ELSE (Lua_FOUND) |
---|
52 | IF (Lua_FIND_REQUIRED) |
---|
53 | MESSAGE(FATAL_ERROR "Could not find Lua") |
---|
54 | ENDIF (Lua_FIND_REQUIRED) |
---|
55 | ENDIF (Lua_FOUND) |
---|