[CMake] Re: Help getting -l and -L arguments from apr-config

Matthew Woehlke mw_triad at users.sourceforge.net
Fri May 4 17:34:45 EDT 2007


Trevor Kellaway wrote:
> Hi,
>> The following snippet will send the strings "1", "2" and "3" 
>> to the messages console, each of them on its own line:
>>
>>   SET(FOO "1 2 3")
>>   STRING(REPLACE " " ";" FOO_LIST "${FOO}")
>>   FOREACH(item ${FOO_LIST})
>>     MESSAGE(${item})
>>   ENDFOREACH(item ${FOO_LIST})
> 
> The "Mastering CMake" book (recommended) also claims you can use this
> (although I haven't tried it):
> 
> 	SEPARATE_ARGUMENTS(VARIABLE)

Alas, that is no more effective than STRING(REPLACE " " ";" FOO ${FOO}), 
as Thomas suggested (and which I am currently using)... although, it 
probably *should* be.

-- FOO (original) = "brown cows" have more fun;
-- FOO (split)    = "brown;cows";have;more;fun;
--   FOO arg = "brown
--   FOO arg = cows"
--   FOO arg = have
--   FOO arg = more
--   FOO arg = fun

...the result should be:

-- FOO (original) = "brown cows" have more fun;
-- FOO (split)    = brown cows;have;more;fun\;
--   FOO arg = brown cows
--   FOO arg = have
--   FOO arg = more
--   FOO arg = fun;

-- 
Matthew
Current geek index: 62%



More information about the CMake mailing list