[Cmake-commits] CMake branch, next, updated. v3.6.0-rc2-464-gccb00d3

Brad King brad.king at kitware.com
Mon Jun 20 14:49:36 EDT 2016


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  ccb00d3533c7c7b0ac972ecd34e41e2759ed5c98 (commit)
       via  eecd307e24a35b68d7ed4fa2f085c283d3e34461 (commit)
       via  3532cbce18f4021507a0fd8d23d0930aa09ae8e1 (commit)
       via  281c707b65dee100f09b4782a3d7e60bc8d29db8 (commit)
       via  92c67b9f01292741428eae12878aad52bf23b002 (commit)
      from  e4245846bc26d5d95c12c59a19d3cfe9d2d82a57 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccb00d3533c7c7b0ac972ecd34e41e2759ed5c98
commit ccb00d3533c7c7b0ac972ecd34e41e2759ed5c98
Merge: e424584 eecd307
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 20 14:49:35 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 20 14:49:35 2016 -0400

    Merge topic 'FindLua-match-header-and-lib' into next
    
    eecd307e FindLua: Iterate through all include subdirs to find a suitable header
    3532cbce FindLua: Check header file against suitable versions
    281c707b FindLua: Factor out a helper function for version extraction
    92c67b9f FindLua: Prefix private APIs with `_lua_`


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eecd307e24a35b68d7ed4fa2f085c283d3e34461
commit eecd307e24a35b68d7ed4fa2f085c283d3e34461
Author:     Ivan Ivanov <anonim288 at gmail.com>
AuthorDate: Mon Jun 20 19:53:45 2016 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 20 14:46:06 2016 -0400

    FindLua: Iterate through all include subdirs to find a suitable header
    
    Fixes #15756.

diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 4af3bbf..f105f3d 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -77,6 +77,8 @@ function(_lua_set_version_vars)
         set(_lua_append_versions ${LUA_VERSIONS5})
     endif ()
 
+    list(APPEND _lua_include_subdirs "include/lua" "include")
+
     foreach (ver IN LISTS _lua_append_versions)
         string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
         list(APPEND _lua_include_subdirs
@@ -131,18 +133,33 @@ endfunction(_lua_check_header_version)
 
 _lua_set_version_vars()
 
-find_path(LUA_INCLUDE_DIR lua.h
-  HINTS
-    ENV LUA_DIR
-  PATH_SUFFIXES ${_lua_include_subdirs} include/lua include
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /sw # Fink
-  /opt/local # DarwinPorts
-  /opt/csw # Blastwave
-  /opt
-)
+if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+    _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
+endif ()
+
+if (NOT LUA_VERSION_STRING)
+    foreach (subdir IN LISTS _lua_include_subdirs)
+        unset(LUA_INCLUDE_PREFIX CACHE)
+        find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
+          HINTS
+            ENV LUA_DIR
+          PATHS
+          ~/Library/Frameworks
+          /Library/Frameworks
+          /sw # Fink
+          /opt/local # DarwinPorts
+          /opt/csw # Blastwave
+          /opt
+        )
+        if (LUA_INCLUDE_PREFIX)
+            _lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
+            if (LUA_VERSION_STRING)
+                set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
+                break()
+            endif ()
+        endif ()
+    endforeach ()
+endif ()
 unset(_lua_include_subdirs)
 unset(_lua_append_versions)
 
@@ -172,10 +189,6 @@ if (LUA_LIBRARY)
     endif ()
 endif ()
 
-if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
-    _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
-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

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3532cbce18f4021507a0fd8d23d0930aa09ae8e1
commit 3532cbce18f4021507a0fd8d23d0930aa09ae8e1
Author:     Ivan Ivanov <anonim288 at gmail.com>
AuthorDate: Mon Jun 20 19:45:59 2016 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 20 14:40:40 2016 -0400

    FindLua: Check header file against suitable versions

diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 6a9d5b5..4af3bbf 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -49,6 +49,7 @@
 
 unset(_lua_include_subdirs)
 unset(_lua_library_names)
+unset(_lua_append_versions)
 
 # this is a function only to have all the variables inside go away automatically
 function(_lua_set_version_vars)
@@ -93,6 +94,7 @@ function(_lua_set_version_vars)
 
     set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
     set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
+    set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
 endfunction(_lua_set_version_vars)
 
 function(_lua_check_header_version _hdr_file)
@@ -116,11 +118,15 @@ function(_lua_check_header_version _hdr_file)
         string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
         string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
     endif ()
-
-    set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
-    set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
-    set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
-    set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
+    foreach (ver IN LISTS _lua_append_versions)
+        if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+            set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
+            set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
+            set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
+            set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
+            return()
+        endif ()
+    endforeach ()
 endfunction(_lua_check_header_version)
 
 _lua_set_version_vars()
@@ -138,6 +144,7 @@ find_path(LUA_INCLUDE_DIR lua.h
   /opt
 )
 unset(_lua_include_subdirs)
+unset(_lua_append_versions)
 
 find_library(LUA_LIBRARY
   NAMES ${_lua_library_names} lua

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=281c707b65dee100f09b4782a3d7e60bc8d29db8
commit 281c707b65dee100f09b4782a3d7e60bc8d29db8
Author:     Ivan Ivanov <anonim288 at gmail.com>
AuthorDate: Mon Jun 20 20:01:32 2016 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 20 14:38:32 2016 -0400

    FindLua: Factor out a helper function for version extraction

diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index eddd94b..6a9d5b5 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -95,6 +95,34 @@ function(_lua_set_version_vars)
     set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
 endfunction(_lua_set_version_vars)
 
+function(_lua_check_header_version _hdr_file)
+    # At least 5.[012] have different ways to express the version
+    # so all of them need to be tested. Lua 5.2 defines LUA_VERSION
+    # and LUA_RELEASE as joined by the C preprocessor, so avoid those.
+    file(STRINGS "${_hdr_file}" lua_version_strings
+         REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
+
+    string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
+    if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
+        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
+        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
+        set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
+    else ()
+        string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
+        if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
+            string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
+        endif ()
+        string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
+        string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
+        string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
+    endif ()
+
+    set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
+    set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
+    set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
+    set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
+endfunction(_lua_check_header_version)
+
 _lua_set_version_vars()
 
 find_path(LUA_INCLUDE_DIR lua.h
@@ -138,29 +166,8 @@ if (LUA_LIBRARY)
 endif ()
 
 if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
-    # At least 5.[012] have different ways to express the version
-    # so all of them need to be tested. Lua 5.2 defines LUA_VERSION
-    # and LUA_RELEASE as joined by the C preprocessor, so avoid those.
-    file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_strings
-         REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
-
-    string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
-    if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
-        set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
-    else ()
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
-            string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        endif ()
-        string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
-    endif ()
-
-    unset(lua_version_strings)
-endif()
+    _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
+endif ()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92c67b9f01292741428eae12878aad52bf23b002
commit 92c67b9f01292741428eae12878aad52bf23b002
Author:     Ivan Ivanov <anonim288 at gmail.com>
AuthorDate: Mon Jun 20 20:00:32 2016 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 20 14:37:49 2016 -0400

    FindLua: Prefix private APIs with `_lua_`

diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 4e00a92..eddd94b 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -51,32 +51,32 @@ unset(_lua_include_subdirs)
 unset(_lua_library_names)
 
 # this is a function only to have all the variables inside go away automatically
-function(set_lua_version_vars)
+function(_lua_set_version_vars)
     set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
 
     if (Lua_FIND_VERSION_EXACT)
         if (Lua_FIND_VERSION_COUNT GREATER 1)
-            set(lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
+            set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
         endif ()
     elseif (Lua_FIND_VERSION)
         # once there is a different major version supported this should become a loop
         if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
             if (Lua_FIND_VERSION_COUNT EQUAL 1)
-                set(lua_append_versions ${LUA_VERSIONS5})
+                set(_lua_append_versions ${LUA_VERSIONS5})
             else ()
                 foreach (subver IN LISTS LUA_VERSIONS5)
                     if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
-                        list(APPEND lua_append_versions ${subver})
+                        list(APPEND _lua_append_versions ${subver})
                     endif ()
                 endforeach ()
             endif ()
         endif ()
     else ()
         # once there is a different major version supported this should become a loop
-        set(lua_append_versions ${LUA_VERSIONS5})
+        set(_lua_append_versions ${LUA_VERSIONS5})
     endif ()
 
-    foreach (ver IN LISTS lua_append_versions)
+    foreach (ver IN LISTS _lua_append_versions)
         string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
         list(APPEND _lua_include_subdirs
              include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
@@ -93,9 +93,9 @@ function(set_lua_version_vars)
 
     set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
     set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
-endfunction(set_lua_version_vars)
+endfunction(_lua_set_version_vars)
 
-set_lua_version_vars()
+_lua_set_version_vars()
 
 find_path(LUA_INCLUDE_DIR lua.h
   HINTS

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

Summary of changes:
 Modules/FindLua.cmake |  117 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 72 insertions(+), 45 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list