<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 02/20/2012 03:50 PM, David Cole wrote:
<blockquote
cite="mid:CAAdwe9XgVYpi9wDSwGo+Hqd2d9ni4dDOzYwra-8Q4PjvoZRMQQ@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Mon, Feb 20, 2012 at 10:42 AM, Eric
Noulard <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
2012/2/20 Andrea Crotti <<a moz-do-not-send="true"
href="mailto:andrea.crotti.0@gmail.com">andrea.crotti.0@gmail.com</a>>:<br>
<div>
<div class="h5">> On 02/20/2012 03:15 PM, David Cole
wrote:<br>
><br>
><br>
> Use:<br>
><br>
> COMMAND ls -l<br>
><br>
> Not:<br>
><br>
> COMMAND "ls -l"<br>
><br>
><br>
> Yes thanks, I started using the "" because I noticed
that sometimes they are<br>
> needed.<br>
> So suppose I want to split the options and the
command, this:<br>
><br>
> set(myoptions one two three)<br>
> set(mycmd ls -l)<br>
><br>
> message(${mycmd} ${myoptions})<br>
><br>
> will produce<br>
> ls-lonetwothree<br>
><br>
> Which is not what I want, but with " I get even a
more strange result:<br>
> message("${mycmd} ${myoptions}")<br>
><br>
> ls;-l one;two;three<br>
><br>
> and in the list command I don't see any way to simply
concatenate two lists,<br>
> so how should I merge two different lists to produce
a command?<br>
<br>
</div>
</div>
You may avoid to create a list in the first place:<br>
set(myoptions "one two three")<br>
instead of<br>
set(myoptions one two three)<br>
<br>
see<br>
cmake --help-command list<br>
<br>
or you can<br>
string(REPLACE ";" " " stringopts "${myoptions}")<br>
message(STATUS "${stringopts}")<br>
<div class="HOEnZb">
<div class="h5"><br>
<br>
--<br>
Erk<br>
Membre de l'April - « promouvoir et défendre le logiciel
libre » -<br>
<a moz-do-not-send="true" href="http://www.april.org"
target="_blank">http://www.april.org</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<div><br>
</div>
<div>If you have:</div>
<div><br>
</div>
<div> set(myoptions one two three)<br>
set(mycmd ls -l)<br>
</div>
<div><br>
</div>
<div>Then:</div>
<div><br>
</div>
<div> COMMAND ${mycmd} ${myoptions}</div>
<div><br>
</div>
<div>should give you what you expect. (Regardless of what the
"message" command's output is.)</div>
<div><br>
</div>
</blockquote>
<br>
<br>
Ah yes you're probably right, I tried it and it works.<br>
It would still be nice to understand how to pass generated lists to
COMMAND, but that's a plus for<br>
the moment, and apparently too hard to get right..<br>
</body>
</html>