Here's a little more context to help understand the use case:

I'm using the BullseyeCoverage as a compiler interceptor. So I have

CMAKE_CXX_COMPILER=/opt/bullseye/bin/g++

Which is symlink that looks like this:

/opt
└── bullseye
    └── bin
        ├── covc
        └── g++ -> covc

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.

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.

Thanks again,
Taylor

On Fri, May 15, 2015 at 11:48 AM, Taylor Braun-Jones <[email protected]
> wrote:

> 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
>
> Thanks,
> Taylor
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to