[CMake] Avoid nested cmake invocation taking parent's info.

Alexander Neundorf a.neundorf-work at gmx.net
Mon Nov 10 15:19:02 EST 2008


On Monday 10 November 2008, Óscar Fuentes wrote:
> Eric NOULARD <eric.noulard at gmail.com>
>
> writes:
> >> The problem is in execute_process. The cmake process created by it is
> >> taking variable values from the enclosing cmake, so it uses the same
> >> compiler, configure variables, etc.
> >
> > What do you mean by "variables"?
> > CMake one or
> > Environment one?
>
> When cmake is invoked with -DCMAKE_TOOLCHAIN_FILE=foo, the nested cmake
> runs as invoked with this definition as well. It takes config-assigned
> variables from the parent cmake, too. 

I don't see how this should happen. Do you cross-compile in-source ?
The the second cmake would see the CMakeCache.txt from the cross compile.
In that case: don't build in-source.
If this is not the reason, please post a small example project so I can see 
what's going on.

Alex


More information about the CMake mailing list