[Cmake-commits] CMake branch, next, updated. v2.8.7-2206-gfac20b8

Rolf Eike Beer eike at sf-mail.de
Mon Jan 23 14:57:32 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  fac20b8adb0a9aa338e670957f62eadf756ecc69 (commit)
       via  7f81c48bdd7901a310744c3b65a8a975cd9cf1a6 (commit)
      from  f9ed351ea5313cef177de225ffcec506702844b5 (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=fac20b8adb0a9aa338e670957f62eadf756ecc69
commit fac20b8adb0a9aa338e670957f62eadf756ecc69
Merge: f9ed351 7f81c48
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Jan 23 14:57:28 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 23 14:57:28 2012 -0500

    Merge topic 'improve-findexpat' into next
    
    7f81c48 FindEXPAT: support version number


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f81c48bdd7901a310744c3b65a8a975cd9cf1a6
commit 7f81c48bdd7901a310744c3b65a8a975cd9cf1a6
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Mon Jan 23 20:53:22 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Mon Jan 23 20:54:04 2012 +0100

    FindEXPAT: support version number

diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 8551fd6..1bf0743 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -24,10 +24,32 @@ FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
 # Look for the library.
 FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
 
+if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+    file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
+         REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$")
+
+    unset(EXPAT_VERSION_STRING)
+    foreach(VPART MAJOR MINOR MICRO)
+        foreach(VLINE ${expat_version_str})
+            if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION")
+                string(REGEX REPLACE "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$" "\\1"
+                       EXPAT_VERSION_PART "${VLINE}")
+                if(EXPAT_VERSION_STRING)
+                    set(EXPAT_VERSION_STRING "${EXPAT_VERSION_STRING}.${EXPAT_VERSION_PART}")
+                else(EXPAT_VERSION_STRING)
+                    set(EXPAT_VERSION_STRING "${EXPAT_VERSION_PART}")
+                endif(EXPAT_VERSION_STRING)
+            endif()
+        endforeach(VLINE)
+    endforeach(VPART)
+endif (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
+
 # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if 
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT
+                                  REQUIRED_VARS EXPAT_LIBRARY EXPAT_INCLUDE_DIR
+                                  VERSION_VAR EXPAT_VERSION_STRING)
 
 # Copy the results to the output variables.
 IF(EXPAT_FOUND)

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

Summary of changes:
 Modules/FindEXPAT.cmake |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list