Merge topic 'CPackDeb-dpkg-shlibdeps-check-flag'

39fc3ed7 CPackDeb: Check dpkg-shlibdeps --ignore-missing-info flag
54a95f5f CPackDeb: Check dpkg-shlibdeps version more robustly
This commit is contained in:
Brad King 2015-06-04 09:13:21 -04:00 committed by CMake Topic Stage
commit 5ec8a04302
1 changed files with 11 additions and 7 deletions

View File

@ -352,10 +352,11 @@ function(cpack_deb_prepare_package_vars)
OUTPUT_VARIABLE _TMP_VERSION OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)" if(_TMP_VERSION MATCHES "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)")
SHLIBDEPS_EXECUTABLE_VERSION set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
"${_TMP_VERSION}") else()
set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}") set(SHLIBDEPS_EXECUTABLE_VERSION "")
endif()
if(CPACK_DEBIAN_PACKAGE_DEBUG) if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb Debug: dpkg-shlibdeps --version output is '${_TMP_VERSION}'") message("CPackDeb Debug: dpkg-shlibdeps --version output is '${_TMP_VERSION}'")
@ -398,9 +399,12 @@ function(cpack_deb_prepare_package_vars)
file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian) file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "") file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
# only set ignore-missing-info flag for dpkg-shlibdeps that have --version option # Add --ignore-missing-info if the tool supports it
# (those are newer and also have --ignore-missing-info flag) execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --help
if(SHLIBDEPS_EXECUTABLE_VERSION) OUTPUT_VARIABLE _TMP_HELP
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_TMP_HELP MATCHES "--ignore-missing-info")
set(IGNORE_MISSING_INFO_FLAG "--ignore-missing-info") set(IGNORE_MISSING_INFO_FLAG "--ignore-missing-info")
endif() endif()