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

Brad King brad.king at kitware.com
Wed Dec 5 08:11:44 EST 2012


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



More information about the cmake-developers mailing list