summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2021-01-19 13:09:46 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-22 13:33:01 (GMT)
commitd586a4ad60f34a14c202a3dd60dbfbf50d69ca7f (patch)
tree3e6619f6619955b83f501d9412b8e08f34c7635c /Modules/Internal
parent2740cc458b858bf0dedec718b0f089694f87cbd4 (diff)
downloadCMake-d586a4ad60f34a14c202a3dd60dbfbf50d69ca7f.zip
CMake-d586a4ad60f34a14c202a3dd60dbfbf50d69ca7f.tar.gz
CMake-d586a4ad60f34a14c202a3dd60dbfbf50d69ca7f.tar.bz2
CPackDeb: dpkg-shlibdeps now supports searching for private shared libs
The new CPack variable `CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS` can be set to a list of directories. If `CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or `CPACK_DEBIAN_<component>_PACKAGE_SHLIBDEPS` are set to `ON` these directories will be searched by `dpkg-shlibdeps` in order to find private shared library dependencies of the libraries/executables that shall be packed.
Diffstat (limited to 'Modules/Internal')
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake17
1 files changed, 15 insertions, 2 deletions
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 48d451a..2ef0489 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}'")