[cmake-developers] PATCH: add subcommand string(APPEND)

Daniel Pfeifer daniel at pfeifer-mail.de
Mon Jul 6 16:47:25 EDT 2015


On Mon, Jul 6, 2015 at 8:41 PM, Brad King <brad.king at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-subcommand-string-APPEND.patch
Type: text/x-patch
Size: 7055 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150706/ebdbbd3d/attachment.bin>


More information about the cmake-developers mailing list