MantisBT - CMake
View Issue Details
0013293CMakeCMakepublic2012-06-11 18:442012-11-05 14:33
Michael.jeulinl 
 
normalfeaturealways
closedno change required 
CMake 2.8.8 
 
0013293: INTERNAL: Cache value overwritten without a FORCE option set.
On INTERNAL type, the cache value is overwritten without a FORCE option set.
cmake_minimum_required(VERSION 2.8.8)

#
# From CMake 2.8.8 documentation:
#
# If <type> is INTERNAL, then the <value> is always written into the cache, replacing any values
# existing in the cache. If it is not a cache variable, then this always writes into the current
# makefile. The FORCE option will overwrite the cache value removing any changes by the user.
#

project(testSetInternal)

message(STATUS "0-Foo:${Foo}")
set(Foo TrueFoo CACHE STRING "Foo value" FORCE)
message(STATUS "1-Foo:${Foo}")
set(Foo Foo CACHE STRING "Foo value")
message(STATUS "2-Foo:${Foo}")

message(STATUS "0-Bar:${Bar}")
set(Bar TrueBar CACHE INTERNAL "Bar value" FORCE)
message(STATUS "1-Bar:${Bar}")
set(Bar Bar CACHE INTERNAL "Bar value")
message(STATUS "2-Bar:${Bar}")
No tags attached.
Issue History
2012-06-11 18:44Michael.jeulinlNew Issue
2012-06-12 08:08Brad KingNote Added: 0029664
2012-06-12 08:08Brad KingStatusnew => resolved
2012-06-12 08:08Brad KingResolutionopen => no change required
2012-11-05 14:33David ColeNote Added: 0031448
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029664)
Brad King   
2012-06-12 08:08   
How is this a bug? The documentation you quote explains exactly the behavior you report. This is by design and has always been the case since CMake started. INTERNAL entries are not available for the user to edit in the GUI so there is no need to preserve user-set values. Please post to the mailing list instead of the issue tracker if you have further questions.
(0031448)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.