diff options
Diffstat (limited to 'Modules/Internal/CPack/CPackDeb.cmake')
-rw-r--r-- | Modules/Internal/CPack/CPackDeb.cmake | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake index 431b074..2ceab10 100644 --- a/Modules/Internal/CPack/CPackDeb.cmake +++ b/Modules/Internal/CPack/CPackDeb.cmake @@ -310,10 +310,23 @@ function(cpack_deb_prepare_package_vars) set(IGNORE_MISSING_INFO_FLAG "--ignore-missing-info") endif() + if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS) + unset(PRIVATE_SEARCH_DIR_OPTIONS) + # Add -l option if the tool supports it + if(DEFINED SHLIBDEPS_EXECUTABLE_VERSION AND SHLIBDEPS_EXECUTABLE_VERSION VERSION_GREATER_EQUAL 1.17.0) + foreach(dir IN LISTS CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS) + list(APPEND PRIVATE_SEARCH_DIR_OPTIONS "-l${dir}") + endforeach() + else() + message(WARNING "CPackDeb: dkpg-shlibdeps is too old. \"CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS\" is therefore ignored.") + endif() + endif() + # Execute dpkg-shlibdeps # --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package + # -l<dir>: make dpkg-shlibdeps also search in this directory for (private) shared library dependencies # -O : print to STDOUT - execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} ${IGNORE_MISSING_INFO_FLAG} -O ${CPACK_DEB_BINARY_FILES} + execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} ${PRIVATE_SEARCH_DIR_OPTIONS} ${IGNORE_MISSING_INFO_FLAG} -O ${CPACK_DEB_BINARY_FILES} WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}" OUTPUT_VARIABLE SHLIBDEPS_OUTPUT RESULT_VARIABLE SHLIBDEPS_RESULT @@ -325,7 +338,7 @@ function(cpack_deb_prepare_package_vars) endif() if(NOT SHLIBDEPS_RESULT EQUAL 0) message(FATAL_ERROR "CPackDeb: dpkg-shlibdeps: '${SHLIBDEPS_ERROR}';\n" - "executed command: '${SHLIBDEPS_EXECUTABLE} ${IGNORE_MISSING_INFO_FLAG} -O ${CPACK_DEB_BINARY_FILES}';\n" + "executed command: '${SHLIBDEPS_EXECUTABLE} ${PRIVATE_SEARCH_DIR_OPTIONS} ${IGNORE_MISSING_INFO_FLAG} -O ${CPACK_DEB_BINARY_FILES}';\n" "found files: '${INSTALL_FILE_}';\n" "files info: '${CPACK_DEB_INSTALL_FILES}';\n" "binary files: '${CPACK_DEB_BINARY_FILES}'") @@ -544,7 +557,7 @@ function(cpack_deb_prepare_package_vars) string(APPEND _description_failure_message " or CPACK_DEBIAN_${_local_component_name}_DESCRIPTION") endif() - message(FATAL_ERROR _description_failure_message) + message(FATAL_ERROR "${_description_failure_message}") endif() # Ok, description has set. According to the `Debian Policy Manual`_ the first @@ -768,6 +781,10 @@ function(cpack_deb_prepare_package_vars) set(GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME "${CPACK_DBGSYM_OUTPUT_FILE_NAME}" PARENT_SCOPE) list(JOIN BUILD_IDS " " BUILD_IDS) set(GEN_BUILD_IDS "${BUILD_IDS}" PARENT_SCOPE) + else() + unset(GEN_DBGSYMDIR PARENT_SCOPE) + unset(GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME PARENT_SCOPE) + unset(GEN_BUILD_IDS PARENT_SCOPE) endif() endfunction() |