summaryrefslogtreecommitdiffstats
path: root/Modules/CPackRPM.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-11-14 17:01:10 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2014-11-14 17:01:10 (GMT)
commit5cc8169bf9c0d04d74fb82e3bcb586095635fba1 (patch)
tree64e64b9154acd517920d23dbaaec50739322c80c /Modules/CPackRPM.cmake
parent0b3b54e21f5ab827d8073ad58de92e73d8688e6b (diff)
downloadCMake-5cc8169bf9c0d04d74fb82e3bcb586095635fba1.zip
CMake-5cc8169bf9c0d04d74fb82e3bcb586095635fba1.tar.gz
CMake-5cc8169bf9c0d04d74fb82e3bcb586095635fba1.tar.bz2
CPackRPM: remove unneeded string length calculation
This wants just the rest of the string, which can be achieved by passing -1 as remainder length.
Diffstat (limited to 'Modules/CPackRPM.cmake')
-rw-r--r--Modules/CPackRPM.cmake4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 56d9b66..66717ef 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -683,9 +683,7 @@ foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC
# Transform NAME --> Name e.g. PROVIDES --> Provides
# The Upper-case first letter and lowercase tail is the
# appropriate value required in the final RPM spec file.
- string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
- math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
- string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
+ string(SUBSTRING ${_RPM_SPEC_HEADER} 1 -1 _PACKAGE_HEADER_TAIL)
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")