[CMake] Weird behaviour of functions with list arguments
Johannes Zarl
Johannes.Zarl at jku.at
Wed Jan 19 06:15:30 EST 2011
On 01/18/2011 at 20:51, Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> On Saturday 11 December 2010, Johannes Zarl wrote:
>> So ARGV0 is not the same as the first argument of ARGV. Why? Is it that
>> the ARGV and ARGN lists get flattened, but the ARGVx are assigned before
>> that?
>>
>> How can I safely access the values of ARGN, if they might contain lists?
>
> Do I understand correctly that you want to pass two lists of things to a
> macro/function ?
> To do this, you have to separate them with keywords.
>
> Since version 2.8.3 (or was it 2.8.2 ?) CMake comes with the module
> CMakeParseArguments.cmake which helps with evaluating such lists of
> arguments. There you can find also documentation.
It turned out that the thing I wanted to do is not quite possible.
AFAIK CMakeParseArguments can't handle keywords that appear more than once.
My basic idea for a workaround was to use one keyword with several
list-arguments and have CMakeParseArguments return a list of lists for that
keyword.
In the end, I did find another solution, though...
Cheers,
Johannes
--
Johannes Zarl
Virtual Reality Services
Johannes Kepler University
Informationsmanagement
Altenbergerstrasze 69
4040 Linz, Austria
Phone: +43 732 2468-8321
johannes.zarl at jku.at
http://vrc.zid.jku.at
More information about the CMake
mailing list