<div dir="ltr">Here's a little more context to help understand the use case:<div><br></div><div>I'm using the BullseyeCoverage as a compiler interceptor. So I have</div><div><br></div><div>CMAKE_CXX_COMPILER=/opt/bullseye/bin/g++</div><div><br></div><div>Which is symlink that looks like this:</div><div><br></div>







<p class=""><font face="monospace, monospace"><span class="">/opt<br></span>└── bullseye<br>    └── bin<br>        ├── covc<br>        └── g++ -> covc</font></p><div><br></div><div>covc is the BullseyeCoverage compiler interceptor that injects the code coverage instrumentation before invoking the real /usr/bin/g++ compiler. So what I really want is for covc to see the environment variables I mentioned. There are also some other BullseyeCoverage tools that get invoked via custom CMake targets that need to see these environment variables as well.</div><div><br></div><div>What I'm hoping exists is a way for me to configure CMake to produce a Makefile (or build.ninja ...) that exports an environment variable before executing the build steps for any target. Or just for certain targets, but for the sake of simplicity, I'd prefer to just export the environment variable for any target and not worry about polluting the environment for targets that don't need/care about the special environment variables.</div><div><br></div><div>Thanks again,</div><div>Taylor</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 15, 2015 at 11:48 AM, Taylor Braun-Jones <span dir="ltr"><<a href="mailto:taylor@braun-jones.org" target="_blank">taylor@braun-jones.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Is it possible for CMake to generate a Makefile that exports environment variables whenever a target is executed? I want all invocations of gcc to see the environment variables COVFILE=xxx and COVSRCDIR=xxx<div><br></div><div>Thanks,</div><div>Taylor</div></div>
</blockquote></div><br></div>