[cmake-developers] How to set environment variable for custom command.

Nicolas Desprès nicolas.despres at gmail.com
Fri Jul 19 10:37:00 EDT 2013


Sorry wrong ML :(.


On Fri, Jul 19, 2013 at 4:36 PM, Nicolas Desprès
<nicolas.despres at gmail.com>wrote:

> Hi,
>
> In Unix shell we can do that:
> $ VAR=foo cmd in out
>
> This way the environment variable is only set in the environment of the
> process of the command and not the in current shell like when using the
> "export" built-in.
>
> I would like to be able to do the same for a custom command in CMake.
> Ideally I was looking for something like that:
>
> add_custom_command(
>   OUTPUT out
>   COMMAND cmd in out
>   DEPENDS in
>   ENVIRONMENT VAR foo
>   )
>
> Any idea?
>
> Cheers,
>
> --
> Nicolas Desprès
>



-- 
Nicolas Desprès
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20130719/c4a774ab/attachment.html>


More information about the cmake-developers mailing list