Out of all the suggestions so far I'd like to say that my preferred solution is Michael's one of:<br><br> SET(<variable> <value> ... CONCAT [SEP <sep>])<br><br>I haven't seen any discussion yet of my 2nd alternative of getting cmake to automatically convert lists to space separated strings for certain variables like CMAKE_EXE_LINKER_FLAGS_RELEASE. If cmake did this then there would be less need for the concat version of set() as one could just use the existing list(APPEND) functionality. Is this a realistic possibility, or are there implementation issues with this suggestion ?<br>
<br>--<br>Glenn<br><br><br><div class="gmail_quote">On 12 August 2011 05:16, Michael Hertling <span dir="ltr"><<a href="mailto:mhertling@online.de">mhertling@online.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 08/11/2011 10:04 PM, Alexander Neundorf wrote:<br>
> On Thursday 11 August 2011, Michael Hertling wrote:<br>
> ...<br>
>> Alternatively, one might consider to introduce a new, say,<br>
>> modifier "CONCAT" for the SET() command, e.g.<br>
>><br>
>> SET(<variable> <value> ... CONCAT [SEP <sep>])<br>
>><br>
>> equivalent to<br>
>><br>
>> SET(<variable> "${<variable>}<sep><value>...")<br>
><br>
> I'm not sure this is actually necessary.<br>
> Personally I'm fine with<br>
> set(foo "${foo} bar")<br>
> It's just one line. For properties more code is needed otherwise.<br>
<br>
</div>So far, I also don't need such a string concatenation feature, but<br>
<br>
LIST(APPEND ...)<br>
<br>
and<br>
<br>
SET_PROPERTY(... APPEND/APPEND_STRING ...)<br>
<br>
aren't actually necessary, too, but convenient, so I would not be<br>
opposed to another convenience feature for concatenating strings.<br>
<div class="im"><br>
>> Besides, David, due to the same reasons as mentioned above, the new<br>
>> APPEND_STRING subcommand of SET_PROPERTY() is quite misnamed, IMO -<br>
>> and quite long. Would it be possible to rename it to CONCAT before<br>
>> it is released officially? In this way, we would consistently have<br>
>> APPEND subcommands for list-style variables/properties and CONCAT<br>
>> subcommands for string-style ones.<br>
><br>
> We can do that, if other people think also that this would be a better name.<br>
> Or "STRING_APPEND" instead of "APPEND_STRING" ?<br>
<br>
</div>The crucial point is that the subcommand/modifier for concatenating<br>
strings - regardless for which command(s) it is implemented - should<br>
<br>
- not be named "APPEND" because this term is already in use for lists,<br>
and there's at least one occasion where a list-related and a string-<br>
related "+=" operation are about to coincide, namely SET_PROPERTY().<br>
- be named the same in all commands that provide - or possibly will<br>
provide - this functionality. SET_PROPERTY() is going to name it<br>
APPEND_STRING, a longish and unfortunate misnomer, IMO, that will<br>
result in inconsistent CMakeLists.txt code if there'll be a SET()<br>
or STRING() implementation for concatenating strings: Certainly,<br>
one would not want to call the latter SET(... APPEND_STRING) or<br>
STRING(STRING_APPEND ...), so one ends up with two differently<br>
named subcommands/modifiers for the same kind of operation.<br>
<br>
For this reason, I'd recommend to reconsider the APPEND_STRING sub-<br>
command's naming and change it to a term that's also suitable for<br>
a string concatenation feature in other CMake commands - just to<br>
leave the door open. Therefor, my suggestion is CONCAT.<br>
<br>
Regards,<br>
<font color="#888888"><br>
Michael<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>