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

Óscar Fuentes ofv at wanadoo.es
Mon Nov 10 17:15:39 EST 2008


Alexander Neundorf <a.neundorf-work at gmx.net>
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 ?

No.

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

I'll put this on my TODO and create a bug report.

For now, I translated the cmake invocation to build time and it works.

-- 
Oscar



More information about the CMake mailing list