MantisBT - CMake
View Issue Details
0010967CMakeCMakepublic2010-07-08 18:022016-06-10 14:31
Marcus D. Hanwell 
Kitware Robot 
normalminoralways
closedmoved 
CMake-2-8 
 
0010967: mark_as_advanced with find_program overwrites local variables on first CMake run
The mark_as_advanced function overwrites local variables on the first CMake invocation when find_program and mark_as_advanced are called multiple times. We observed this in the Titan project where MPIEXEC was set as a local variable, find_program didn't make a cache entry as MPIEXEC was defined, but mark_as_advanced did. The subsequent run of find_program then defined a type and overwrote the local variable (leaving an empty string).

I have attached two files, placed in the same directory you should be able to reproduce this error. I observed it on Windows with CMake 2.8.1 and on Linux with a fresh build of CMake master from today.
First CMake run,

MPIEXEC 1: No changing me!,
MPIEXEC 2: No changing me!, UNINITIALIZED
MPIEXEC 3: , FILEPATH

Second CMake run,

MPIEXEC 1: No changing me!, FILEPATH
MPIEXEC 2: No changing me!, FILEPATH
MPIEXEC 3: No changing me!, FILEPATH
No tags attached.
tgz mark_as_advanced.tgz (473) 2010-07-08 18:02
https://public.kitware.com/Bug/file/3235/mark_as_advanced.tgz
Issue History
2010-07-08 18:02Marcus D. HanwellNew Issue
2010-07-08 18:02Marcus D. HanwellFile Added: mark_as_advanced.tgz
2010-07-08 18:02Marcus D. HanwellStatusnew => assigned
2010-07-08 18:02Marcus D. HanwellAssigned To => David Cole
2011-10-25 22:36David ColeTarget Version => CMake 2.8.7
2011-12-13 19:20David ColeNote Added: 0027965
2011-12-13 19:20David ColeTarget VersionCMake 2.8.7 =>
2012-08-13 15:12David ColeStatusassigned => backlog
2012-08-13 15:12David ColeNote Added: 0030599
2012-08-13 15:21David ColeAssigned ToDavid Cole =>
2016-06-10 14:28Kitware RobotNote Added: 0041726
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027965)
David Cole   
2011-12-13 19:20   
Unset target version field; too late for a fix to go into 2.8.7; deferred until a future version.
(0030599)
David Cole   
2012-08-13 15:12   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041726)
Kitware Robot   
2016-06-10 14:28   
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.