[Cmake-commits] CMake branch, next, updated. v2.8.7-2687-g0f856c5

Rolf Eike Beer eike at sf-mail.de
Fri Feb 17 12:47:04 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  0f856c54befc47dc4b9238e5a877435b27135f91 (commit)
       via  bb1ba19ed73ef1e5dce10c69adbf57daa83b683b (commit)
       via  f58cce031e7c641c0ae216a66595837eb1b4dee7 (commit)
      from  fcfb7c98570673f29de75612a784edcefdff6573 (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=0f856c54befc47dc4b9238e5a877435b27135f91
commit 0f856c54befc47dc4b9238e5a877435b27135f91
Merge: fcfb7c9 bb1ba19
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Feb 17 12:47:00 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 17 12:47:00 2012 -0500

    Merge topic 'improve-findfreetype' into next
    
    bb1ba19 AllFindModules test: be strict about FREETYPE and LibXslt version
    f58cce0 FindFreetype: support version selection


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb1ba19ed73ef1e5dce10c69adbf57daa83b683b
commit bb1ba19ed73ef1e5dce10c69adbf57daa83b683b
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Feb 17 18:46:23 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Feb 17 18:46:23 2012 +0100

    AllFindModules test: be strict about FREETYPE and LibXslt version
    
    Enforce the version to be found if the library is found, at least for the moment.
    This makes it easy to see if there are cases that are not covered by the current
    code.

diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index f76f0d9..373470f 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -48,8 +48,8 @@ endif (NOT QT4_FOUND)
 # If any of these modules reported that it was found a version number should have been
 # reported.
 set(VERSIONS_REQUIRED
-    ALSA BISON BZIP2 CUPS CURL DOXYGEN EXPAT FLEX GETTEXT GIF GIT
-    ImageMagick JASPER LibArchive LIBXML2 PERL PostgreSQL SWIG TIFF ZLIB)
+    ALSA BISON BZIP2 CUPS CURL DOXYGEN EXPAT FLEX FREETYPE GETTEXT GIF GIT
+    ImageMagick JASPER LibArchive LIBXML2 LIBXSLT PERL PostgreSQL SWIG TIFF ZLIB)
 
 foreach(VTEST ${VERSIONS_REQUIRED})
     if (${VTEST}_FOUND)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f58cce031e7c641c0ae216a66595837eb1b4dee7
commit f58cce031e7c641c0ae216a66595837eb1b4dee7
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Feb 17 18:31:23 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Feb 17 18:31:23 2012 +0100

    FindFreetype: support version selection

diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 6251805..e6f6702 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -3,6 +3,7 @@
 #  FREETYPE_LIBRARIES, the library to link against
 #  FREETYPE_FOUND, if false, do not try to link to FREETYPE
 #  FREETYPE_INCLUDE_DIRS, where to find headers.
+#  FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
 #  This is the concatenation of the paths:
 #  FREETYPE_INCLUDE_DIR_ft2build
 #  FREETYPE_INCLUDE_DIR_freetype2
@@ -77,10 +78,33 @@ IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
 ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
 SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
 
+IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+    FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
+         REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
+
+    UNSET(FREETYPE_VERSION_STRING)
+    FOREACH(VPART MAJOR MINOR PATCH)
+        FOREACH(VLINE ${freetype_version_str})
+            IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
+                STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
+                       FREETYPE_VERSION_PART "${VLINE}")
+                IF(FREETYPE_VERSION_STRING)
+                    SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
+                ELSE(FREETYPE_VERSION_STRING)
+                    SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
+                ENDIF(FREETYPE_VERSION_STRING)
+                UNSET(FREETYPE_VERSION_PART)
+            ENDIF()
+        ENDFOREACH(VLINE)
+    ENDFOREACH(VPART)
+ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+
+
 # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype  DEFAULT_MSG  FREETYPE_LIBRARY  FREETYPE_INCLUDE_DIRS)
-
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
+                                  REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
+                                  VERSION_VAR FREETYPE_VERSION_STRING)
 
 MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

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

Summary of changes:
 Modules/FindFreetype.cmake                    |   28 +++++++++++++++++++++++-
 Tests/CMakeOnly/AllFindModules/CMakeLists.txt |    4 +-
 2 files changed, 28 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list