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