3 # LUA51_FOUND, if false, do not try to link to Lua
5 # LUA_INCLUDE_DIR, where to find lua.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
18 PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
25 /opt/local # DarwinPorts
30 FIND_LIBRARY(LUA_LIBRARY
31 NAMES lua51 lua5.1 lua-5.1 lua
34 PATH_SUFFIXES lib64 lib
47 # include the math library for Unix
48 IF(UNIX AND NOT APPLE)
49 FIND_LIBRARY(LUA_MATH_LIBRARY m)
50 SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
51 # For Windows and Mac, don't need to explicitly include the math library
52 ELSE(UNIX AND NOT APPLE)
53 SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
54 ENDIF(UNIX AND NOT APPLE)
57 INCLUDE(FindPackageHandleStandardArgs)
58 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
59 # all listed variables are TRUE
60 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 DEFAULT_MSG LUA_LIBRARIES LUA_INCLUDE_DIR)
62 MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)