3 # LUA_LIBRARIES, both lua and lualib
4 # LUA_FOUND, if false, do not try to link to Lua
5 # LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
7 # Note that the expected include convention is
10 # #include <lua/lua.h>
11 # This is because, the lua location is not standardized and may exist
12 # in locations other than lua/
15 FIND_PATH(LUA_INCLUDE_DIR lua.h
19 PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
22 FIND_PATH(LUA_INCLUDE_DIR lua.h
29 /opt/local # DarwinPorts
32 PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
35 FIND_LIBRARY(LUA_LIBRARY_lua
36 NAMES lua50 lua5.0 lua5 lua
40 PATH_SUFFIXES lib64 lib
43 FIND_LIBRARY(LUA_LIBRARY_lua
44 NAMES lua50 lua5.0 lua5 lua
54 PATH_SUFFIXES lib64 lib
57 # In an OS X framework, lualib is usually included as part of the framework
58 # (like GLU in OpenGL.framework)
59 IF(${LUA_LIBRARY_lua} MATCHES "framework")
60 SET( LUA_LIBRARIES "${LUA_LIBRARY_lua}" CACHE STRING "Lua framework")
61 ELSE(${LUA_LIBRARY_lua} MATCHES "framework")
62 FIND_LIBRARY(LUA_LIBRARY_lualib
63 NAMES lualib50 lualib5.0 lualib5 lualib
68 PATH_SUFFIXES lib64 lib
71 FIND_LIBRARY(LUA_LIBRARY_lualib
72 NAMES lualib50 lualib5.0 lualib5 lualib
80 PATH_SUFFIXES lib64 lib
82 IF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
83 # include the math library for Unix
84 IF(UNIX AND NOT APPLE)
85 FIND_LIBRARY(MATH_LIBRARY_FOR_LUA m)
86 SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua};${MATH_LIBRARY_FOR_LUA}" CACHE STRING "This is the concatentation of lua and lualib libraries")
87 # For Windows and Mac, don't need to explicitly include the math library
88 ELSE(UNIX AND NOT APPLE)
89 SET( LUA_LIBRARIES "${LUA_LIBRARY_lualib};${LUA_LIBRARY_lua}" CACHE STRING "This is the concatentation of lua and lualib libraries")
90 ENDIF(UNIX AND NOT APPLE)
91 ENDIF(LUA_LIBRARY_lualib AND LUA_LIBRARY_lua)
92 ENDIF(${LUA_LIBRARY_lua} MATCHES "framework")
97 IF(LUA_LIBRARIES AND LUA_INCLUDE_DIR)
99 ENDIF(LUA_LIBRARIES AND LUA_INCLUDE_DIR)