MantisBT - CMake
View Issue Details
0015099CMakeCMakepublic2014-08-19 13:032016-06-10 14:31
Chris Volpe 
Kitware Robot 
normalminorhave not tried
closedmoved 
IntelWindows7
CMake 3.0 
 
0015099: CMake stores hidden cache values in Registry
> I have been using CMake to build a few open-source projects recently, and I've been experimenting and moving around build directories and such. In a small test application, CMake tries to find a library that I built and installed in one place, and then I rebuilt and installed somewhere else. Meanwhile, I changed the "<library>_ROOT" environment variable to point to the new location, restarted CMake to pick up the new environment variable, and deleted the cache. There should be no record left of the old location of the library (which wasn't in a "standard" location such as "C:\Program Files"), but still, CMake is finding the old location. There should be nothing pointing CMake to this location anymore, but it's still doing so. On a hunch, I searched through the Windows Registry and found several keys of the form H_C_R\Software\Kitware\CMakeSetup\Settings\StartPath\WhereBuild where is an integer. One of these contains the offending path. Is there a way to tell CMake to ignore this and start fresh? Obviously, "delete cache" doesn't do the trick. Is my only option to go into regedit.exe and delete these things from time to time?
Just go into the registry and look at those keys.
Robert Maynard replied on the CMake mailing list as follows:

Hi these registry entries are added by cmake-gui and I don't see any way for them to be cleared. Can you please create a new bug on http://public.kitware.com/Bug/view_all_bug_page.php [^] with this issue and I will look into adding a feature to cmake-gui to clear dead paths.
No tags attached.
Issue History
2014-08-19 13:03Chris VolpeNew Issue
2014-08-19 13:42Brad KingNote Added: 0036650
2014-08-19 13:44Brad KingNote Added: 0036651
2014-08-19 14:08Robert MaynardNote Added: 0036652
2014-08-19 14:13Brad KingNote Added: 0036653
2016-06-10 14:29Kitware RobotNote Added: 0042610
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036650)
Brad King   
2014-08-19 13:42   
The find_package command:

 http://www.cmake.org/cmake/help/v3.0/command/find_package.html [^]

has a NO_CMAKE_BUILDS_PATH option to skip this part, but that solution depends on the consuming project using the option.

This feature of find_package was originally created to simplify the use case of manually building a sequence of dependent packages with cmake-gui, such that each can find those recently built.

The find_package command specifies some search locations that are prioritized before the cmake-gui registry entries: CMAKE_PREFIX_PATH, HINTS. Using one of those, or just plain setting <pkg>_DIR to the right place explicitly will avoid use of the cmake-gui registry entries.

Still, it would be nice to have a feature of cmake-gui to keep the list of recently used projects somewhere that find_package does not search. That would give local users the option of skipping this feature.
(0036651)
Brad King   
2014-08-19 13:44   
For reference, the original mailing list thread is here:

 "Hidden" cache values in Registry?
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/50213 [^]
(0036652)
Robert Maynard   
2014-08-19 14:08   
I just want to note that this registry entries are created by the cmake-gui application, and not the ones created by the export command.

I think initially we should support a cmake-gui tools options to that will delete all registry entries that aren't a valid path anymore.
(0036653)
Brad King   
2014-08-19 14:13   
Re 0015099:0036652: The WhereBuild registry entries are just the recently-used project drop-down selection box storage. The find_package command abuses these. The cmake-gui should automatically drop entries from the list that do not exist anymore (if it does not already). However, find_package will not consider locations from these registry entries that do not exist, so this use case involves an existing path that is simply not the one desired.

I would like to see the actual find_package call that somehow uses the _ROOT variable and finds the wrong location.
(0042610)
Kitware Robot   
2016-06-10 14:29   
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.