On May 16, 2015 12:18 PM, "Dan Kegel" <d...@kegel.com> wrote:

> Write a wrapper script that sets the variables and invokes the compiler,
> and tell cmake that's your compiler.
>

Ya, I thought about this but aside from having an interceptor for an
interceptor there are also other complexities like:

(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.

(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.

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.

Taylor

[1]
http://www.cmake.org/cmake/help/v3.2/manual/cmake-properties.7.html#properties-on-tests
-- 

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