[Cmake-commits] CMake branch, next, updated. v2.8.7-2277-g7c725c2

Rolf Eike Beer eike at sf-mail.de
Thu Jan 26 03:09:27 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  7c725c24979965a288b6e0dcebf08d26eb28fe60 (commit)
       via  49b69add60d6fcd56688e276c3a4010759dade05 (commit)
      from  e8b867897e0df0d56950ab945ec45ed820e90d75 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c725c24979965a288b6e0dcebf08d26eb28fe60
commit 7c725c24979965a288b6e0dcebf08d26eb28fe60
Merge: e8b8678 49b69ad
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Jan 26 03:09:25 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jan 26 03:09:25 2012 -0500

    Merge topic 'improve-findlua51' into next
    
    49b69ad FindLua51: add version support


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49b69add60d6fcd56688e276c3a4010759dade05
commit 49b69add60d6fcd56688e276c3a4010759dade05
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Wed Jan 25 23:39:21 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Jan 26 09:07:53 2012 +0100

    FindLua51: add version support

diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index 123fd5d..b67dd4c 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -2,7 +2,8 @@
 # This module defines
 #  LUA51_FOUND, if false, do not try to link to Lua 
 #  LUA_LIBRARIES
-#  LUA_INCLUDE_DIR, where to find lua.h 
+#  LUA_INCLUDE_DIR, where to find lua.h
+#  LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
 #
 # Note that the expected include convention is
 #  #include "lua.h"
@@ -66,10 +67,19 @@ IF(LUA_LIBRARY)
   ENDIF(UNIX AND NOT APPLE)
 ENDIF(LUA_LIBRARY)
 
+IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+  FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
+
+  STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
+  UNSET(lua_version_str)
+ENDIF()
+
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 
 # all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51  DEFAULT_MSG  LUA_LIBRARIES LUA_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
+                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
+                                  VERSION_VAR LUA_VERSION_STRING)
 
 MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindLua51.cmake |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list