ngompa / rpms / cmake

Forked from rpms/cmake 4 years ago
Clone
6289c6
diff -up cmake-2.8.11-rc4/Modules/FindLua52.cmake.lua-52 cmake-2.8.11-rc4/Modules/FindLua52.cmake
6289c6
--- cmake-2.8.11-rc4/Modules/FindLua52.cmake.lua-52	2013-05-13 09:41:15.221278404 -0400
6289c6
+++ cmake-2.8.11-rc4/Modules/FindLua52.cmake	2013-05-13 09:03:43.422233385 -0400
6289c6
@@ -0,0 +1,73 @@
6289c6
+# Locate Lua library
6289c6
+# This module defines
6289c6
+#  LUA52_FOUND, if false, do not try to link to Lua
6289c6
+#  LUA_LIBRARIES
6289c6
+#  LUA_INCLUDE_DIR, where to find lua.h
6289c6
+#  LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
6289c6
+#
6289c6
+# Note that the expected include convention is
6289c6
+#  #include "lua.h"
6289c6
+# and not
6289c6
+#  #include <lua/lua.h>
6289c6
+# This is because, the lua location is not standardized and may exist
6289c6
+# in locations other than lua/
6289c6
+
6289c6
+#=============================================================================
6289c6
+# Copyright 2007-2009 Kitware, Inc.
6289c6
+#
6289c6
+# Distributed under the OSI-approved BSD License (the "License");
6289c6
+# see accompanying file Copyright.txt for details.
6289c6
+#
6289c6
+# This software is distributed WITHOUT ANY WARRANTY; without even the
6289c6
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6289c6
+# See the License for more information.
6289c6
+#=============================================================================
6289c6
+# (To distribute this file outside of CMake, substitute the full
6289c6
+#  License text for the above reference.)
6289c6
+
6289c6
+find_path(LUA_INCLUDE_DIR lua.h
6289c6
+  HINTS
6289c6
+    ENV LUA_DIR
6289c6
+  PATH_SUFFIXES include/lua52 include/lua5.2 include/lua-5.2 include/lua include
6289c6
+  PATHS
6289c6
+  ~/Library/Frameworks
6289c6
+  /Library/Frameworks
6289c6
+  /sw # Fink
6289c6
+  /opt/local # DarwinPorts
6289c6
+  /opt/csw # Blastwave
6289c6
+  /opt
6289c6
+)
6289c6
+
6289c6
+find_library(LUA_LIBRARY
6289c6
+  NAMES lua52 lua5.2 lua-5.2 lua
6289c6
+  HINTS
6289c6
+    ENV LUA_DIR
6289c6
+  PATH_SUFFIXES lib
6289c6
+  PATHS
6289c6
+  ~/Library/Frameworks
6289c6
+  /Library/Frameworks
6289c6
+  /sw
6289c6
+  /opt/local
6289c6
+  /opt/csw
6289c6
+  /opt
6289c6
+)
6289c6
+
6289c6
+if(LUA_LIBRARY)
6289c6
+  # include the math library for Unix
6289c6
+  if(UNIX AND NOT APPLE AND NOT BEOS)
6289c6
+    find_library(LUA_MATH_LIBRARY m)
6289c6
+    set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
6289c6
+  # For Windows and Mac, don't need to explicitly include the math library
6289c6
+  else()
6289c6
+    set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
6289c6
+  endif()
6289c6
+endif()
6289c6
+
6289c6
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
6289c6
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
6289c6
+# all listed variables are TRUE
6289c6
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
6289c6
+                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR)
6289c6
+
6289c6
+mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
6289c6
+