[cmake-developers] Fwd: List from strings (CMAKE_CXX_FLAGS and friends)

James Bigler jamesbigler at gmail.com
Wed Dec 5 14:01:15 EST 2012


Ah, yes.  That is what I needed: separate_arguments.

Thanks,
James


On Wed, Dec 5, 2012 at 6:11 AM, Brad King <brad.king at kitware.com> wrote:

> On 12/04/2012 07:31 PM, James Bigler wrote:
> > Is this a bug or is what I'm trying to do impossible?
>
> In the code
>
> >     set(mylist a b c)
> >     set(mystring "a b c")
> >     set(mylist_from_string ${mystring})
>
> the ${mystring} is evaluated and arguments are divided only on ';' so it
> results in a single argument.  It is not whitespace-based like in shell
> syntax.
>
> Look at the separate_arguments command to parse command lines on
> whitespace and get CMake lists back.
>
> -Brad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121205/0dd546f5/attachment.html>


More information about the cmake-developers mailing list