list(APPEND) requires at least one element argument, right?

Can you require the same thing for string(APPEND)?  That would make it
symmetric and remove your edge case.

On Mon, Jul 6, 2015 at 2:47 PM, Daniel Pfeifer <dan...@pfeifer-mail.de>
wrote:

> On Mon, Jul 6, 2015 at 8:41 PM, Brad King <brad.k...@kitware.com> wrote:
> > On 07/04/2015 06:27 PM, Daniel Pfeifer wrote:
> >> Attached is a patch that adds a subcommand string(APPEND).
> >> This allows to write
> >>
> >>> string(APPEND string_variable "some string")
> >>
> >> instead of
> >>
> >>> set(string_variable "${string_variable}some string")
> >
> > Thanks.  Please extend the first patch to also add explicit coverage
> > of the feature in the test suite, perhaps in Tests/RunCMake/string
> > similar to the Concat test case.  I'd prefer to get the implementation,
> > documentation, and tests of the new command integrated and working
> > before considering use of the command everywhere else.
>
> OK, now with tests and release notes.
>
> There is a debatable edge case:
> When a variable is not-set and zero elements are appended, do we
> expect the result to be a) not-set or b) an empty string?
> My current implementation considers appending zero elements a no-op,
> i.e. it follows approach a).
>
> cheers, Daniel
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to