[cmake-developers] Arbitrary content in JOIN genex separator
Stephen Kelly
steveire at gmail.com
Thu May 2 11:03:14 EDT 2013
Brad King wrote:
> On 04/23/2013 03:26 PM, Stephen Kelly wrote:
>> The $<JOIN> branch is almost ready, but I thought something worth
>> bringing up is the use of a comma as a separator.
> [snip]
>> $<JOIN:one;two;three,,> # results in one,two,three
>>
>> Do you think that's more or less confusing? Should I implement it?
>
> I think the literal "," is fine. Authors that think it is confusing
> can choose to use $<COMMA> if they wish.
Ok. I implemented it in join-genex in my clone. While implementing it, I
discovered a bug in the handling of commas in arbitrary content which has
existed since they were introduced, which is also fixed in that branch.
>
> However, won't
>
> -I$<JOIN:$<TARGET_PROP:${target},INCLUDE_DIRECTORIES>,-I>
>
> result in
>
> -Ia-Ib-Ic
>
> ?
Yes.
> What decides if the output of a JOIN is a list or string?
It's always a string. Adding a semicolon to your separator generates a
cmake-list:
-I$<JOIN:$<TARGET_PROP:${target},INCLUDE_DIRECTORIES>,;-I>
or use \n to generate a file with one include per line, as I did in the qt4
moc macros patch.
Thanks,
Steve.
More information about the cmake-developers
mailing list