summaryrefslogtreecommitdiffstats
path: root/Modules/FindPNG.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindPNG.cmake')
-rw-r--r--Modules/FindPNG.cmake6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 873c3de..fa04bf0 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -56,10 +56,8 @@ if(ZLIB_FOUND)
list(APPEND PNG_NAMES png libpng)
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 MATCHES "^([0-9]+)\\.([0-9]+)(\\..*)?$")
+ set(_PNG_VERSION_SUFFIX_MIN "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
if (PNG_FIND_VERSION_EXACT)
set(_PNG_VERSION_SUFFIXES ${_PNG_VERSION_SUFFIX_MIN})
else ()