[CMake] Setting environment variables for custom targets

Josef Karthauser joe.karthauser at geomerics.com
Thu Nov 15 13:53:25 EST 2007


> -----Original Message-----
> From: cmake-bounces+joe.karthauser=geomerics.com at cmake.org
> [mailto:cmake-bounces+joe.karthauser=geomerics.com at cmake.org] On
Behalf
> Of Brandon Van Every
> Sent: 15 November 2007 14:17
> To: cmake at cmake.org
> Subject: Re: [CMake] Setting environment variables for custom targets
> > It doesn't appear that,
> >
> >         SET(ENV{MYVAR} FOO)
> >        ADD_CUSTOM_TARGET(MYTARGET mycommand args),
> >
> > does the right thing, as the environment var MYVAR is only set
during
> > the cmake build, but not populated at build time and so not utilised
> by
> > the custom target.
> 
> Wrap your external command in a CMake script.
> 

How so?  Can you give me an example?

Joe


More information about the CMake mailing list