summaryrefslogtreecommitdiff
path: root/Modules/CPackDeb.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-03-30 09:09:51 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2008-03-30 09:09:51 -0400
commitbf5f91f058155c136443e922a3bec6811729a0f3 (patch)
tree4801b7fa211ef0fb9a81d87fb36a16f53cfeb5b9 /Modules/CPackDeb.cmake
parent69e3f0d2e9d0f9351383fe492e1f2399c5c82565 (diff)
downloadcmake-bf5f91f058155c136443e922a3bec6811729a0f3.tar.gz
ENH: merge from main tree
Diffstat (limited to 'Modules/CPackDeb.cmake')
-rw-r--r--Modules/CPackDeb.cmake14
1 files changed, 11 insertions, 3 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index dcce5c6a19..bf21172bb1 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -34,14 +34,22 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
# Architecture: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
-# There is no such thing as i686 architecture on debian, you should use i386 instead
-# $ dpkg --print-architecture
- SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
+ # There is no such thing as i686 architecture on debian, you should use i386 instead
+ # $ dpkg --print-architecture
+ FIND_PROGRAM(DPKG_CMD dpkg)
+ IF(NOT DPKG_CMD)
+ MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
+ SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
+ ENDIF(NOT DPKG_CMD)
+ EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
+ OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# have a look at GET_PROPERTY(result GLOBAL PROPERTY ENABLED_FEATURES),
# this returns the successful FIND_PACKAGE() calls, maybe this can help
# Depends:
+# You should set: DEBIAN_PACKAGE_DEPENDS
+# TODO: automate 'objdump -p | grep NEEDED'
IF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
MESSAGE(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)