Ah, okay.

Thanks for your fast reply.

Is there a way to change the value in the cache?

Stefan

2010/9/6 Alexander Neundorf <neund...@kde.org>:
> On Monday 06 September 2010, Stefan Köhnen wrote:
>> Hello,
>>
>> I am trying to set a variable that appears in CMakeCache. I made this
>> small example to show what I am trying to do.
>>
>> CMakeLists.txt:
>> PROJECT(CMakeTest)
>>
>> SET(VAR_FOR_TEST "firstValue" CACHE STRING "Just for testing")
>>
>> set(VAR_FOR_TEST "secondValue")
>>
>> MESSAGE (${VAR_FOR_TEST})
>>
>>
>> When I run cmake from the build-folder I get the message
>> "secondValue", but when I look in the CMakeCache.txt-file I see this:
>>
>> //Just for testing
>> VAR_FOR_TEST:STRING=firstValue
>>
>> Why is VAR_FOR_TEST set to firstValue, there is probably something I
>> missed in my CMakeLists.txt but I found no example for this kind of
>> problem on the Internet.
>
> The first set() stores the value in the cache. The second set() create
> basically a second variable with the same name, which is not in the cache,
> and which shadows the one from the cache.
>
> Alex
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to