MantisBT - CMake
View Issue Details
0008228CMakeCMakepublic2008-12-04 18:472016-06-10 14:30
mwoehlke 
Bill Hoffman 
normalminoralways
closedmoved 
CMake-2-6 
 
0008228: cmake allows creating variables that cannot be dereferenced
Test CMakeLists.txt:

set(!BANG wacky CACHE STRING "" FORCE)
set("var with space" wacky CACHE STRING "" FORCE)

Both of these will create entries in the cache. However, as evidenced by:

message(STATUS "This is !BANG: ${!BANG}")
message(STATUS "This is var with space: ${var with space}")

...such variables cannot be expanded (attempting to do so throws an error). CMake should preferably not allow such variables to be created.
I discovered this while implementing a work-around to bug 8226, basically with the autotools-ism 'if ("!${foo}" MATCHES "bar")'. Therefore I would prefer for such variables to remain invalid :-).
No tags attached.
Issue History
2008-12-04 18:47mwoehlkeNew Issue
2008-12-15 10:40Bill HoffmanStatusnew => assigned
2008-12-15 10:40Bill HoffmanAssigned To => Bill Hoffman
2016-06-10 14:27Kitware RobotNote Added: 0041476
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0041476)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.