LUA.cmake 806 B

1234567891011121314151617181920212223242526272829303132
  1. # -*- cmake -*-
  2. if (LUA_CMAKE_INCLUDED)
  3. return()
  4. endif (LUA_CMAKE_INCLUDED)
  5. set (LUA_CMAKE_INCLUDED TRUE)
  6. include(Prebuilt)
  7. set(LUA_FIND_QUIETLY ON)
  8. set(LUA_FIND_REQUIRED OFF)
  9. if (USESYSTEMLIBS)
  10. include(FindLua)
  11. if (LUA_FOUND AND (LUA_VERSION_MAJOR LESS 5 OR LUA_VERSION_MINOR LESS 4))
  12. set(LUA_FOUND "NO")
  13. endif ()
  14. endif (USESYSTEMLIBS)
  15. if (NOT LUA_FOUND)
  16. use_prebuilt_binary(liblua)
  17. set(LUA_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
  18. if (LINUX)
  19. set(LUA_LIBRARIES ${LIBS_PREBUILT_DIR}/lib/release/liblua.a)
  20. elseif (WINDOWS)
  21. set(LUA_LIBRARIES ${LIBS_PREBUILT_DIR}/lib/release/lua54.lib)
  22. elseif (DARWIN)
  23. set(LUA_LIBRARIES ${LIBS_PREBUILT_DIR}/lib/release/liblua.a)
  24. endif (LINUX)
  25. set(LUA_FOUND "YES")
  26. endif (NOT LUA_FOUND)
  27. include_directories(SYSTEM LUA_INCLUDE_DIR)