[CMake] Setting global make variable from CMake,

Łukasz Tasz lukasz at tasz.eu
Mon Feb 21 10:22:05 EST 2011


2011/2/21 Eric Noulard <eric.noulard at gmail.com>:
>
> Since the makefiles are generated by CMake WHY do you need
> to define a "make" var?
>
> What do you want to do ?
>
> CMake was not designed to let you decide generator specifics things.
>
That's  cool, I really like it, and in most cases it works fine e.g
CMAKE_VERBOSE_MAKE,
Developer can modifiy GCC flags etc.

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

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


Thanks a lot for help


-- 
Lukasz Tasz


More information about the CMake mailing list