summaryrefslogtreecommitdiffstats
path: root/Modules/CPackRPM.cmake
diff options
context:
space:
mode:
authorJoshua A Clayton <stillcompiling@gmail.com>2015-02-19 08:01:15 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-23 15:48:27 (GMT)
commit3aa9f89dbb88d957a662effdbc284c95aef1a8a9 (patch)
tree4c1a6f69228583b31e4256a21f2aa8e4680f9feb /Modules/CPackRPM.cmake
parent761562fea6a987bb898f5a349993cf5765dedbea (diff)
downloadCMake-3aa9f89dbb88d957a662effdbc284c95aef1a8a9.zip
CMake-3aa9f89dbb88d957a662effdbc284c95aef1a8a9.tar.gz
CMake-3aa9f89dbb88d957a662effdbc284c95aef1a8a9.tar.bz2
CPackRPM: Support rpm architecture in components
CPACK_RPM_<component>_PACKAGE_ARCHITECTURE variable allows the same project to support packages of different architectures including noarch, native and foreign architectures.
Diffstat (limited to 'Modules/CPackRPM.cmake')
-rw-r--r--Modules/CPackRPM.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 932e174..6ce18bf 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -51,6 +51,7 @@
# * Default : CPACK_PACKAGE_VERSION
#
# .. variable:: CPACK_RPM_PACKAGE_ARCHITECTURE
+# CPACK_RPM_<component>_PACKAGE_ARCHITECTURE
#
# The RPM package architecture.
#
@@ -631,6 +632,16 @@ else()
endif()
set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_PACKAGE_ARCHITECTURE})
+
+#prefer component architecture
+if(CPACK_RPM_PACKAGE_COMPONENT)
+ if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE)
+ set(_CPACK_RPM_PACKAGE_ARCHITECTURE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_ARCHITECTURE})
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: using component build arch = ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
+ endif()
+ endif()
+endif()
if(${_CPACK_RPM_PACKAGE_ARCHITECTURE} STREQUAL "noarch")
set(TMP_RPM_BUILDARCH "Buildarch: ${_CPACK_RPM_PACKAGE_ARCHITECTURE}")
else()