[CMake] cmake-gui(beta) does not show a change in CMAKE_CXX_FLAGS

Philip Lowman philip at yhbt.com
Mon Dec 1 23:42:57 EST 2008


On Mon, Dec 1, 2008 at 3:39 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> David Genest wrote:
>
>> Hi,
>>  In a Visual Studio Generator context...
>>  I set a compiler flag in my CMakeLists.txt, but the change is not
>> reflected in the gui (advanced values), even if the project setting is
>> correct. I find this error prone, because it gives the user incorrect
>> information about the current configuration. Is this by design?
>>
>>  Example code:
>>  Set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
>>
>>  I would expect to see this change in the gui also. But now I see /EHsc.
>>
>> Thanks,
>>
> That is because you are setting the value in memory and not in the cache.
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa" CACHE FORCE "") will do what
> you want.  However, the user will NOT be able to edit from the gui if you do
> that.  Because each time cmake is run the cache FORCE will change the
> values.


Has a FORCE_ONCE option ever been considered?  The idea would be to allow
the user to (as a one time operation) to force a cache value on top of an
already existing cache entry.  It would be useful for appending options, for
example.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081201/fc656c3d/attachment-0001.htm>


More information about the CMake mailing list