summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-03 13:21:52 (GMT)
committerBrad King <brad.king@kitware.com>2015-06-03 13:22:27 (GMT)
commit54a95f5fc66574cd9fff07024cc449b160b5629a (patch)
treebee659bb9fe355c0b36c1006492cfc530a865c93 /Modules
parenta6916a6c6e397bda8b381f65dbfc59d3c52f8525 (diff)
downloadCMake-54a95f5fc66574cd9fff07024cc449b160b5629a.zip
CMake-54a95f5fc66574cd9fff07024cc449b160b5629a.tar.gz
CMake-54a95f5fc66574cd9fff07024cc449b160b5629a.tar.bz2
CPackDeb: Check dpkg-shlibdeps version more robustly
Use if(MATCHES) to verify that a match exists before using the match group variable.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 226153c..48f6dd1 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -352,10 +352,11 @@ function(cpack_deb_prepare_package_vars)
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
- SHLIBDEPS_EXECUTABLE_VERSION
- "${_TMP_VERSION}")
- set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ if(_TMP_VERSION MATCHES "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)")
+ set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ else()
+ set(SHLIBDEPS_EXECUTABLE_VERSION "")
+ endif()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb Debug: dpkg-shlibdeps --version output is '${_TMP_VERSION}'")