summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/cmake/modules/FindLuaAndSwig.cmake
blob: 2e99933a745696b70a9d4d8d438ec76d18e675fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#.rst:
# FindLuaAndSwig
# --------------
#
# Find Lua and SWIG as a whole.

if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND SWIG_EXECUTABLE)
  set(LUAANDSWIG_FOUND TRUE)
else()
  find_package(SWIG 2.0 QUIET)
  if (SWIG_FOUND)
    find_package(Lua QUIET)
    if(LUA_FOUND AND SWIG_FOUND)
      mark_as_advanced(
        LUA_LIBRARIES
        LUA_INCLUDE_DIR
        SWIG_EXECUTABLE)
    endif()
  else()
    message(STATUS "SWIG 2 or later is required for Lua support in LLDB but could not be found")
  endif()

  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(LuaAndSwig
                                    FOUND_VAR
                                      LUAANDSWIG_FOUND
                                    REQUIRED_VARS
                                      LUA_LIBRARIES
                                      LUA_INCLUDE_DIR
                                      SWIG_EXECUTABLE)
endif()