[CMake] Indrect function calls

David Cole david.cole at kitware.com
Wed Sep 7 16:19:18 EDT 2011


There are already these feature requests that seem to cover the exact
same topic:

  http://public.kitware.com/Bug/view.php?id=11845
  http://public.kitware.com/Bug/view.php?id=4034

I personally do not think that "EVAL" adds significant value to the
CMake language. And I think it would introduce vastly more
complexity/confusion than it could possibly be worth. But that's just
my own personal 2 cents.

Use tcl if you want eval.


David C.


On Wed, Sep 7, 2011 at 3:49 PM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/9/7 Firegurafiku <firegurafiku at gmail.com>:
>
> Do not forget to CC the ML (or reply to ML).
>
>>> With CMake:
>>>  1) you can ask CMake for "double" evaluation
>>>      using nested dollar ($) var value:
>>>
>>>     Try:
>>>     set(COMP1_CFLAGS "Whatever")
>>>     set(COMP2_CFLAGS "OrElse")
>>>     set(COMPILER "COMP1")
>>>
>>>     set(CFLAGS ${${COMPILER}_CFLAGS})
>>>     message("CFLAGS=${CFLAGS}")
>> Yes I know it, but in my example avr_compiler_<COMPILER>_cflags() must
>> construct cflags from other variables values, the way how it is
>> constructed is very compiler-specific, so, using single variable isn't
>> flexible enough.
>
> OK.
>
>>>   2) You can "emulate" function call evaluation using include
>>>       this is awkward but seems to work, see example attached.
>> Yes, it works but doesn't seems to be very good-looking.
>>
>>> That said adding a eval command to CMake could be fun,
>>> even if I did never cross the urgent need for it.
>> I guess this feature is not very hard to implement in cmake since it
>> is a scripting language. Could you add such a feature request to cmake
>> bugtracker?
>
> You should discuss the request a little bit on the ML before filing
> the feature request in order to verify that it seems reasonable to others
> including Kitware people.
>
> After you know that the feature seems acceptable open a feature request
> yourself and since you think it shouldn't be to hard, go ahead and
> provide a patch for that by attach it to the feature request.
>
> Speaking for myself I won't have time any time soon to work on that, sorry.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list