Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-13 Thread Domen Vrankar
>> > This should be a good addition, no? >> > >> > 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 >> > PROVIDE

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-13 Thread Rolf Eike Beer
Am Donnerstag, 13. November 2014, 13:07:52 schrieben Sie: > On 11/13/2014 12:48 PM, Rolf Eike Beer wrote: > > This should be a good addition, no? > > > > diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake > > index 56d9b66..66717ef 100644 > > --- a/Modules/CPackRPM.cmake > > +++ b/Module

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-13 Thread Brad King
On 11/13/2014 12:48 PM, Rolf Eike Beer wrote: > This should be a good addition, no? > > 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 REQU

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-13 Thread Rolf Eike Beer
Am Donnerstag, 13. November 2014, 11:19:26 schrieb Brad King: > On 11/12/2014 06:08 PM, Domen Vrankar wrote: > > Attached is the final patch. > > Applied with minor tweaks, thanks: > > string: Tolerate SUBSTRING length exceeding end index > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=474

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-13 Thread Brad King
On 11/12/2014 06:08 PM, Domen Vrankar wrote: > Attached is the final patch. Applied with minor tweaks, thanks: string: Tolerate SUBSTRING length exceeding end index http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=474bbb9d -Brad -- Powered by www.kitware.com Please keep messages on-topic

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-12 Thread Domen Vrankar
> You could check the value of the CMAKE_MINIMUM_REQUIRED_VERSION > variable to decide whether to make it an error. Extend the error > message to mention that it could be fixed by requiring a new > enough version of CMake. OTOH, there have been many times in the > past where we've converted an er

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-12 Thread Brad King
On 11/12/2014 10:23 AM, Domen Vrankar wrote: > I would also prefer implicit behavior but in that case should it still > be treated as error if CMake minimum required version is set to less > than 3.1 since it would break on older versions of CMake? > I know that CMake policies exist but I am not fa

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-12 Thread Domen Vrankar
2014-11-12 15:54 GMT+01:00 Robert Maynard : > I vote for the implicit behavior of SUBSTRING for it to tolerate > out-of-range indexes. I would also prefer implicit behavior but in that case should it still be treated as error if CMake minimum required version is set to less than 3.1 since it would

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-12 Thread Robert Maynard
I vote for the implicit behavior of SUBSTRING for it to tolerate out-of-range indexes. On Wed, Nov 12, 2014 at 8:56 AM, Brad King wrote: > On 11/11/2014 06:16 PM, Domen Vrankar wrote: >> string(SUBSTRING [TRUNCATE]) > [snip] >> string(SUBSTRING ${test_str} 2 6 substr TRUNCATE) >> >> If length

Re: [cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-12 Thread Brad King
On 11/11/2014 06:16 PM, Domen Vrankar wrote: > string(SUBSTRING [TRUNCATE]) [snip] > string(SUBSTRING ${test_str} 2 6 substr TRUNCATE) > > If length is set to a higher value than the length of the original > string the substring is still created but its end is the end of > original string. Th

[cmake-developers] string SUBSTRING TRUNCATE mode

2014-11-11 Thread Domen Vrankar
Hi, I wrote a patch that adds functionality to string SUBSTRING command: string(SUBSTRING [TRUNCATE]) When TRUNCATE is set this is valid: cmake_minimum_required (VERSION 3.0) project(string_test) set(test_str "abcd") string(SUBSTRING ${test_str} 2 6 substr TRUNCATE) message(${test_str}) mes