[CMake] Setting global make variable from CMake,

Eric Noulard eric.noulard at gmail.com
Mon Feb 21 10:35:58 EST 2011


2011/2/21 Łukasz Tasz <lukasz at tasz.eu>:
> 2011/2/21 Eric Noulard <eric.noulard at gmail.com>:
>> What is your use case?
>
> In my case I'm making integration with ccache, and distcc, and as you
> know all of them are tuned only via ENV_VARS.
> Depending on CMAKE_BUILD_TYPE, compiler version, OS I would like to
> prepare correct DISTCC_HOSTS variable etc.

Ok I see.

> That is why in my mind setting global make variable is a solution, at
> least my brain wouled generate such a makefile:)
> Another solution that poped up in my mind is to register this variable
> before calling compiler/linker,
> Do you know such a call can be configured?
> for example:
> export MYVARIABVLE=test; cd dir; compiler_call

I don't think there is an easy way to do that from within CMake.
You would need some way to set env var "before" launching the compile rule
the only way I see would be to craft a compile script for each case.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list