From 49da3bdb2de4266955330f092b369a7afba0ca9d Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Mon, 5 Sep 2011 22:43:45 +0200 Subject: CPackDeb fix #10325 automagically use fakeroot for DEB if fakeroot is found --- Modules/CPackDeb.cmake | 5 +++++ Source/CPack/cmCPackDebGenerator.cxx | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 90c80a4..d1c0bbe 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -133,6 +133,11 @@ IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +FIND_PROGRAM(FAKEROOT_EXECUTABLE fakeroot) +IF(FAKEROOT_EXECUTABLE) + SET(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE}) +ENDIF(FAKEROOT_EXECUTABLE) + IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # dpkg-shlibdeps is a Debian utility for generating dependency list FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 8c19bbd..b707e96 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -392,7 +392,10 @@ int cmCPackDebGenerator::createDeb() } std::string cmd; - cmd = "\""; + if (NULL != this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE")) { + cmd += this->GetOption("CPACK_DEBIAN_FAKEROOT_EXECUTABLE"); + } + cmd += " \""; cmd += cmakeExecutable; cmd += "\" -E tar cfz data.tar.gz "; -- cgit v0.12