1 # - Find library containing Lua()
2 # The following variables are set if Lua is found. If Lua is not
3 # found, Lua_FOUND is set to false.
4 # Lua_FOUND - System has Lua.
5 # Lua_LIBRARIES - Link these to use Lua.
6 # Lua_CFLAGS - Link these to use Lua.
10 include(CheckLibraryExists)
12 set(Lua_SEARCHED TRUE CACHE INTERNAL "")
13 set(Lua_FOUND FALSE CACHE INTERNAL "")
15 pkg_check_modules(Lua lua>=5.1)
17 pkg_check_modules(Lua lua5.1)
21 find_library( Lua_LIBRARY NAMES lua5.1 lua51 lua)
23 set(Lua_LIBRARIES "${Lua_LIBRARY}" CACHE INTERNAL "")
24 set(Lua_FOUND TRUE CACHE INTERNAL "")
29 if (NOT Lua_FIND_QUIETLY)
30 message(STATUS "Found Lua in: ${Lua_LIBRARIES}")
31 endif (NOT Lua_FIND_QUIETLY)
33 if (Lua_FIND_REQUIRED)
34 message(FATAL_ERROR "Could not find the library containing Lua")
35 endif (Lua_FIND_REQUIRED)
38 mark_as_advanced(Lua_LIBRARIES)
39 endif(NOT Lua_SEARCHED)