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

Brad King brad.king at kitware.com
Mon Jul 6 14:41:04 EDT 2015


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.

> Two other patches make use of this subcommand. The changes have been
> created with
> 
>> find Modules -type f -print0 | xargs -0 perl -i -0pe \
>> 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'

Nice.  I'm also glad to see those instructions in the commit message.
This will make it easy to create these changes later after the feature
itself is worked out as above.

Thanks,
-Brad



More information about the cmake-developers mailing list