[CMake] The else() in CMAKE_TOOLCHAIN_FILE

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Wed Apr 3 08:19:00 EDT 2013


On 03. april 2013 13:13, Johannes Zarl wrote:
> Hi,
>
> On Tuesday, 2. April 2013, 06:42:47, Ashi wrote:
>> I think I find something to explain this: the config.cmake(the
>> CMAKE_TOOLCHAIN_FILE) is reloaded several times. on first-load, the A is
>> set, but on second-load and later-load, the A is not set. I think I can get
>> around this problem when A is kept set. However, I don't know how can I
>> keep the value set in cmake. Could anyone give me some suggestion? Thanks!
> I'm not entirely sure what you're trying to do, but it seems like you would 
> want to make A, B, and C into cache variables. That way subsequent cmake runs 
> will use the same value...
>
>   Johannes
>

Hi,

I'm thinking that one solution could be to create three (or four?)
toolchain files, one for each if clause?

Cheers,
Yngve


More information about the CMake mailing list