[946] | 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 | # |
---|
[1037] | 11 | # Redistribution and use is allowed according to the terms of the BSD license. |
---|
| 12 | |
---|
[1076] | 13 | MESSAGE(STATUS "lua libs in cache: ${Lua_LIBRARIES}") |
---|
[946] | 14 | IF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) |
---|
| 15 | SET(Lua_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
[1037] | 16 | ENDIF (Lua_LIBRARIES AND Lua_INCLUDE_DIR) |
---|
| 17 | |
---|
| 18 | FIND_PATH(Lua_INCLUDE_DIR lua.h |
---|
| 19 | /usr/include/lua5.1 |
---|
| 20 | /usr/local/include/lua5.1 |
---|
| 21 | ../libs/lua-5.1.3/src) |
---|
| 22 | |
---|
| 23 | FIND_LIBRARY(Lua_LIBRARIES lua5.1 |
---|
| 24 | /usr/lib |
---|
| 25 | /usr/local/lib |
---|
| 26 | ../libs/lua-5.1.3/lib) |
---|
| 27 | |
---|
| 28 | IF (NOT Lua_INCLUDE_DIR) |
---|
[1076] | 29 | FIND_PATH(Lua_INCLUDE_DIR lua.h |
---|
[1037] | 30 | /usr/include/lua50 |
---|
| 31 | /usr/local/include/lua50 |
---|
| 32 | /usr/pack/lua-5.0.3-sd/include) |
---|
| 33 | ENDIF (NOT Lua_INCLUDE_DIR) |
---|
| 34 | |
---|
| 35 | IF (NOT Lua_LIBRARIES) |
---|
[1076] | 36 | FIND_LIBRARY(Lua_LIBRARIES lua50 |
---|
[1037] | 37 | /usr/lib |
---|
| 38 | /usr/local/lib) |
---|
| 39 | |
---|
[1076] | 40 | FIND_LIBRARY(Lua_LIBRARY lualib50 |
---|
[1037] | 41 | /usr/lib |
---|
| 42 | /usr/local/lib) |
---|
| 43 | |
---|
[1076] | 44 | #SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY}) |
---|
[1037] | 45 | ENDIF (NOT Lua_LIBRARIES) |
---|
| 46 | |
---|
[1076] | 47 | #especially for tardis |
---|
[1037] | 48 | IF (NOT Lua_LIBRARIES) |
---|
[1076] | 49 | FIND_LIBRARY(Lua_LIBRARIES lua |
---|
[1037] | 50 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib) |
---|
| 51 | |
---|
[1076] | 52 | FIND_LIBRARY(Lua_LIBRARY lualib |
---|
[1037] | 53 | /usr/pack/lua-5.0.3-sd/i686-debian-linux3.1/lib) |
---|
| 54 | |
---|
[1076] | 55 | #SET(Lua_LIBRARIES ${Lua_LIBRARIES} ${Lua_LIBRARY}) |
---|
[1037] | 56 | ENDIF (NOT Lua_LIBRARIES) |
---|
| 57 | |
---|
[946] | 58 | IF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
| 59 | SET(Lua_FOUND TRUE) |
---|
| 60 | ENDIF (Lua_INCLUDE_DIR AND Lua_LIBRARIES) |
---|
| 61 | |
---|
| 62 | IF (Lua_FOUND) |
---|
| 63 | MESSAGE(STATUS "Found Lua: ${Lua_LIBRARIES}") |
---|
[1076] | 64 | MESSAGE(STATUS "Found Lua: ${Lua_LIBRARY}") |
---|
[946] | 65 | ELSE (Lua_FOUND) |
---|
| 66 | IF (Lua_FIND_REQUIRED) |
---|
| 67 | MESSAGE(FATAL_ERROR "Could not find Lua") |
---|
| 68 | ENDIF (Lua_FIND_REQUIRED) |
---|
[1037] | 69 | ENDIF (Lua_FOUND) |
---|