2011/7/6 Alexander Neundorf <a.neundorf-w...@gmx.net>

> On Wednesday 06 July 2011, Jerry Gagelman wrote:
>
> If these variables exist already in the cache, then a simple
> set(... CACHE ...)
> does not override the value which is already in the cache.
> You can only override a value in the cache from a CMakeLists.txt by using
> set(... CACHE... FORCE)
> This will put the given value always in the cache. Which also means if the
> user changes the value using "make edit_cache", the set(...CACHE ... FORCE)
> will override his changes again.
>
> Is this the behaviour you are seeing ?
>
>
Thanks. That is the behavior I'm seeing. But it's still not satisfactory. Is
it not possible to "initialize" variables in the cache with values using the
set() command?

I just tried the following, ignoring the cache altogether:

set( CMAKE_C_FLAGS_DEBUG "-Wall -Wno-format -g -DDEBUG" )
set( CMAKE_C_FLAGS_RELEASE "-Wall -Wno-unknown-pragmas -Wno-format -O3" )

I rebuilt everything, ensured that the CMAKE_BUILD_TYPE variable in the
cache is set to "Debug," and built the library using verbose Makefiles. The
compilation commands don't include the extra CMAKE_C_FLAGS_DEBUG flags as
directed.

I even tried it without quotes around the flag strings.

Evidently the cache is overriding commands in CMakeLists.txt.

Does anyone know if this is supposed to be a feature? If so, it feels rather
strange. I'm happy to file a bug report.

Thanks,
Jerry
_______________________________________________
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