summaryrefslogtreecommitdiffstats
path: root/Modules/CPackDeb.cmake
diff options
context:
space:
mode:
authorHenning Meyer <henning.meyer@dedrone.com>2016-12-07 19:45:45 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-12-07 21:25:06 (GMT)
commite326d8cf3eb2ac3f98fe5b4783b35c6141c006a9 (patch)
tree9f87828f4fb3a489580efa6a5507e7b2884d7061 /Modules/CPackDeb.cmake
parenta0d64ecf8b9eac29cbfeb7461cf3bcb1688f7aa7 (diff)
downloadCMake-e326d8cf3eb2ac3f98fe5b4783b35c6141c006a9.zip
CMake-e326d8cf3eb2ac3f98fe5b4783b35c6141c006a9.tar.gz
CMake-e326d8cf3eb2ac3f98fe5b4783b35c6141c006a9.tar.bz2
CPack/DEB shlibdep options depend on file utility
Missing or missconfigured file utility should not skip adding dependencies. Instead it should print out a fatal error message. Fixes #16486
Diffstat (limited to 'Modules/CPackDeb.cmake')
-rw-r--r--Modules/CPackDeb.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 909a12b..bee69d9 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -587,12 +587,21 @@ function(cpack_deb_prepare_package_vars)
file(GLOB_RECURSE FILE_PATHS_ LIST_DIRECTORIES false RELATIVE "${WDIR}" "${WDIR}/*")
cmake_policy(POP)
+ find_program(FILE_EXECUTABLE file)
+ if(NOT FILE_EXECUTABLE)
+ message(FATAL_ERROR "CPackDeb: file utility is not available. CPACK_DEBIAN_PACKAGE_SHLIBDEPS and CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS options are not available.")
+ endif()
+
# get file info so that we can determine if file is executable or not
unset(CPACK_DEB_INSTALL_FILES)
foreach(FILE_ IN LISTS FILE_PATHS_)
- execute_process(COMMAND file "./${FILE_}"
+ execute_process(COMMAND env LC_ALL=C ${FILE_EXECUTABLE} "./${FILE_}"
WORKING_DIRECTORY "${WDIR}"
+ RESULT_VARIABLE FILE_RESULT_
OUTPUT_VARIABLE INSTALL_FILE_)
+ if(NOT FILE_RESULT_ EQUAL 0)
+ message (FATAL_ERROR "CPackDeb: execution of command: '${FILE_EXECUTABLE} ./${FILE_}' failed with exit code: ${FILE_RESULT_}")
+ endif()
list(APPEND CPACK_DEB_INSTALL_FILES "${INSTALL_FILE_}")
endforeach()