<div dir="ltr"><p dir="ltr">On May 16, 2015 12:18 PM, "Dan Kegel" <<a href="mailto:dank@kegel.com" target="_blank">dank@kegel.com</a>> wrote:<br></p><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Write a wrapper script that sets the variables and invokes the compiler,<br>
and tell cmake that's your compiler.<br></blockquote><div><br></div><p dir="ltr">Ya, I thought about this but aside from having an interceptor for an interceptor there are also other complexities like:</p><p dir="ltr">(1) One of the values contains the path to the build dir so now I'd need to _generate_ the interceptor script that I want to use as my CMAKE_CXX_COMPILER.</p><p>(2) I also want the environment variables to be visible to the executables that get invoked when building various other targets. Since the paths to these executables get discovered by CMake (they are not necessarily in the system PATH) I'd be stuck generating several wrapper/interceptor scripts. </p><p>These issues could likely be overcome with workarounds, but I'm trying hard to keep the build simple and understandable. Since CMake already has an ENVIRONMENT property for tests[1] it seemed like a reasonable and symmetric feature would be to support an ENVIRONMENT property for targets as well.</p><p>Taylor</p><p>[1] <a href="http://www.cmake.org/cmake/help/v3.2/manual/cmake-properties.7.html#properties-on-tests">http://www.cmake.org/cmake/help/v3.2/manual/cmake-properties.7.html#properties-on-tests</a></p></div>
</div>