[Cmake-commits] CMake branch, next, updated. v2.8.7-2263-ga50d29c

Rolf Eike Beer eike at sf-mail.de
Wed Jan 25 12:29:16 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  a50d29c3e955b9409c4a1c260d869036f37b9e4d (commit)
       via  0051506aa4ea3e1fdbe5333b529a0a5af9476be5 (commit)
      from  5338178fafd77e2d027f5f70dbb23f941a4e23ca (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=a50d29c3e955b9409c4a1c260d869036f37b9e4d
commit a50d29c3e955b9409c4a1c260d869036f37b9e4d
Merge: 5338178 0051506
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Wed Jan 25 12:29:13 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 25 12:29:13 2012 -0500

    Merge topic 'improve-findpng' into next
    
    0051506 FindPNG: support version selection


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0051506aa4ea3e1fdbe5333b529a0a5af9476be5
commit 0051506aa4ea3e1fdbe5333b529a0a5af9476be5
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Wed Jan 25 18:24:44 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Wed Jan 25 18:24:57 2012 +0100

    FindPNG: support version selection

diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index f616973..a6c181c 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -7,6 +7,7 @@
 #  PNG_LIBRARIES, the libraries to link against to use PNG.
 #  PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
 #  PNG_FOUND, If false, do not try to use PNG.
+#  PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
 # Also defined, but not for general use are
 #  PNG_LIBRARY, where to find the PNG library.
 # For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS.
@@ -56,11 +57,19 @@ if(ZLIB_FOUND)
 
   endif (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
 
+  if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
+      file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
+
+      string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
+      unset(png_version_str)
+  endif (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
 endif(ZLIB_FOUND)
 
 # handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
 # all listed variables are TRUE
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(PNG  DEFAULT_MSG  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
+find_package_handle_standard_args(PNG
+                                  REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
+                                  VERSION_VAR PNG_VERSION_STRING)
 
 mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )

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

Summary of changes:
 Modules/FindPNG.cmake |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list