patch-cmake_FindLua_cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. $OpenBSD: patch-cmake_FindLua_cmake,v 1.1.1.1 2016/01/23 19:15:13 landry Exp $
  2. Also detect the lua compiler: on openbsd, its not luac
  3. nor lua5Xc but luac5X
  4. --- cmake/FindLua.cmake.orig Sat Jan 23 17:24:05 2016
  5. +++ cmake/FindLua.cmake Sat Jan 23 17:28:06 2016
  6. @@ -34,6 +34,7 @@
  7. # Always search for non-versioned lua first (recommended)
  8. SET(_POSSIBLE_LUA_INCLUDE include include/lua)
  9. SET(_POSSIBLE_LUA_EXECUTABLE lua)
  10. +SET(_POSSIBLE_LUA_COMPILER luac)
  11. SET(_POSSIBLE_LUA_LIBRARY lua)
  12. # Determine possible naming suffixes (there is no standard for this)
  13. @@ -47,6 +48,7 @@ ENDIF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINO
  14. FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES})
  15. LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}")
  16. LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}")
  17. + LIST(APPEND _POSSIBLE_LUA_COMPILER "luac${_SUFFIX}")
  18. LIST(APPEND _POSSIBLE_LUA_LIBRARY "lua${_SUFFIX}")
  19. ENDFOREACH(_SUFFIX)
  20. @@ -55,6 +57,11 @@ FIND_PROGRAM(LUA_EXECUTABLE
  21. NAMES ${_POSSIBLE_LUA_EXECUTABLE}
  22. )
  23. +# Find the lua compiler
  24. +FIND_PROGRAM(LUA_COMPILER
  25. + NAMES ${_POSSIBLE_LUA_COMPILER}
  26. +)
  27. +
  28. # Find the lua header
  29. FIND_PATH(LUA_INCLUDE_DIR lua.h
  30. HINTS
  31. @@ -114,5 +121,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
  32. REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
  33. VERSION_VAR LUA_VERSION_STRING)
  34. -MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE)
  35. +MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE LUA_COMPILER)