2924
|
1 |
# Find the Lua library
|
|
2 |
#
|
|
3 |
|
2925
|
4 |
IF(NOT LUA_LIBRARY)
|
|
5 |
IF(WIN32)
|
3067
|
6 |
SET(LUA_DEFAULT lua.dll)
|
2925
|
7 |
ELSE(WIN32)
|
|
8 |
IF(APPLE)
|
3067
|
9 |
SET(LUA_DEFAULT lua)
|
2925
|
10 |
ELSE(APPLE)
|
3067
|
11 |
#locate the system's lua library
|
|
12 |
FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
|
3125
|
13 |
IF(LUA_DEFAULT EQUALS "LUA_FEDAULT-NOTFOUND")
|
|
14 |
UNSET(LUA_DEFAULT)
|
|
15 |
MESSAGE(FATAL_ERROR "Couldn't find Lua 5.1 library!")
|
|
16 |
ENDIF()
|
3067
|
17 |
#remove the path (fpc doesn't like it - why?)
|
|
18 |
GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
|
2925
|
19 |
ENDIF(APPLE)
|
|
20 |
ENDIF(WIN32)
|
|
21 |
SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
|
3067
|
22 |
UNSET(LUA_DEFAULT)
|
2925
|
23 |
ENDIF(NOT LUA_LIBRARY) |