[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3443-gfa08081

Rolf Eike Beer eike at sf-mail.de
Sat Jul 27 16:37:26 EDT 2013


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  fa080816bf8998a5020137760462bd9cd6052070 (commit)
       via  2a7975398f4e7fb02887539c19bea5f390f1156f (commit)
      from  50066dacca0d3bbe6d346b15737f58c467f94eff (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=fa080816bf8998a5020137760462bd9cd6052070
commit fa080816bf8998a5020137760462bd9cd6052070
Merge: 50066da 2a79753
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Jul 27 16:37:24 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jul 27 16:37:24 2013 -0400

    Merge topic 'FindPNG-dbg-rel' into next
    
    2a79753 FindPNG: improve library detection (#14301)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a7975398f4e7fb02887539c19bea5f390f1156f
commit 2a7975398f4e7fb02887539c19bea5f390f1156f
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sat Jul 27 22:35:11 2013 +0200
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sat Jul 27 22:35:11 2013 +0200

    FindPNG: improve library detection (#14301)
    
    -add support for upcoming version 1.7
    -improve version selection, use the major and minor of the requested version
     to generate the library suffix list
    -support detection of release and debug libraries

diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index fef4669..33c2971 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -39,10 +39,37 @@ if(ZLIB_FOUND)
   )
 
   list(APPEND PNG_NAMES png libpng)
-  foreach(v 16 15 14 12)
-    list(APPEND PNG_NAMES png${v} libpng${v} png${v}d libpng${v}d)
+  unset(PNG_NAMES_DEBUG)
+  set(_PNG_VERSION_SUFFIXES 17 16 15 14 12)
+  if (PNG_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\..*)?$")
+    string(REGEX REPLACE
+        "^([0-9]+)\\.([0-9]+).*" "\\1\\2"
+        _PNG_VERSION_SUFFIX_MIN "${PNG_FIND_VERSION}")
+    if (PNG_FIND_VERSION_EXACT)
+      set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN})
+    else ()
+      string(REGEX REPLACE
+          "${_PNG_VERSION_SUFFIX_MIN}.*" "${_PNG_VERSION_SUFFIX_MIN}"
+          _PNG_VERSION_SUFFIXES "${_PNG_VERSION_SUFFIXES}")
+    endif ()
+    unset(_PNG_VERSION_SUFFIX_MIN)
+  endif ()
+  foreach(v IN LISTS _PNG_VERSION_SUFFIXES)
+    list(APPEND PNG_NAMES png${v} libpng${v})
+    list(APPEND PNG_NAMES_DEBUG png${v}d libpng${v}d)
   endforeach()
-  find_library(PNG_LIBRARY NAMES ${PNG_NAMES} )
+message(STATUS "PNG r: ${PNG_NAMES} d: ${PNG_NAMES_DEBUG}")
+  unset(_PNG_VERSION_SUFFIXES)
+  find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES})
+  find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG})
+  unset(PNG_NAMES)
+  unset(PNG_NAMES_DEBUG)
+
+  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+  select_library_configurations(PNG)
+  # Set by select_library_configurations(), but we want the one from
+  # find_package_handle_standard_args() below.
+  unset(PNG_FOUND)
 
   if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
       # png.h includes zlib.h. Sigh.

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

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


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list