From 32fb2e6c1b9fb32a78f31f2d5ad13ebe34e308cf Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 26 Sep 2014 14:41:42 +0000 Subject: [PATCH] Fix package file naming on Linux to include architecture. The *nix package generators do not include the target architecture in the package file names. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4382 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeCPackOptions.cmake.in | 10 +++++++++- CMakeLists.txt | 9 +++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 1e51ab8c2..f900fe02c 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -76,10 +76,18 @@ endif () if ("${CPACK_GENERATOR}" STREQUAL "DEB") set (CPACK_DEBIAN_PACKAGE_DESCRIPTION "@PROJECT_DESCRIPTION@") - set (CPACK_PACKAGE_FILE_NAME "@DEBIAN_PACKAGE_FILE_NAME@") + set (CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}) set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "@PROJECT_HOMEPAGE@") set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgfortran3 (>=4.8.2), libqt5multimedia5-plugins (>=5), libqt5widgets5 (>=5), libc6 (>=2.19)") set (CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} Debian) endif ("${CPACK_GENERATOR}" STREQUAL "DEB") +if ("${CPACK_GENERATOR}" STREQUAL "RPM") + set (CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CPACK_RPM_PACKAGE_ARCHITECTURE}) +endif ("${CPACK_GENERATOR}" STREQUAL "RPM") + +if ("${CPACK_GENERATOR}" STREQUAL "TGZ") + set (CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.@CMAKE_SYSTEM_PROCESSOR@) +endif ("${CPACK_GENERATOR}" STREQUAL "TGZ") + message (STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 067bbcf35..40eb21653 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -945,7 +945,6 @@ else () # Derive the correct filename for a Debian package because the DEB # generator doesn't do this correctly at present. # - string (TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE) find_program (DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") if (DPKG_PROGRAM) execute_process ( @@ -953,16 +952,14 @@ else () OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE ) - set (DEBIAN_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME_LOWERCASE}_${wsjtx_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") - else (DPKG_PROGRAM) - set (DEBIAN_PACKAGE_FILE_NAME - "${CPACK_PACKAGE_NAME_LOWERCASE}_${wsjtx_VERSION}_${CMAKE_SYSTEM_NAME}") + set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE noarch) endif (DPKG_PROGRAM) set (CPACK_DEBIAN_PACKAGE_PACKAGE_SHLIBDEPS ON) + set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) + set (CPACK_GENERATOR "DEB" "RPM" "TGZ") endif ()