[cmake-developers] [CMake 0011955]: InstallSystemRuntimeLibraries has faulty detection of Visual Studio locations, fails on 64-bit

Mantis Bug Tracker mantis at public.kitware.com
Wed Mar 9 19:16:37 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=11955 
====================================================================== 
Reported By:                Craig Scott
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11955
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-03-09 19:16 EST
Last Modified:              2011-03-09 19:16 EST
====================================================================== 
Summary:                    InstallSystemRuntimeLibraries has faulty detection
of Visual Studio locations, fails on 64-bit
Description: 
The InstallSystemRuntimeLibraries module has faulty logic for detecting where
Visual Studio lives (I'm testing with Visual Studio 9.0 using the "NMake
Makefiles" generator). There are multiple problems. The first is the following
near the top of the file:

  GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)

The CMAKE_MAKE_PROGRAM variable only contains the executable name without a
path, in this case "nmake". This means devenv_dir gets an empty string and thus
base_dir will always be nonesense. I've checked and this applies on both 32-bit
and 64-bit Windows.

The second problem is that the 64-bit version of Visual Studio 9.0 doesn't
define all the registry entries that the 32-bit version does. In particular, the
32-bit version defines the following registry key:

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]

However, on 64-bit Windows, there is no InstallDir registry entry. In fact,
there are *no* registry entries in that location, although the 9.0 directory
does exist and it does have sub-entries. The result of this is that
InstallSystemRuntimeLibraries will work on 32-bit Windows but not on 64-bit
Windows because this registry key is one of the locations that it looks at when
trying to work out where the MSVC runtimes live.

As a temporary workaround, if you manually add an InstallDir entry for 64-bit
such that it points to the same equivalent thing as under 32-bit, then
InstallSystemRuntimeLibraries does appear to work (or at least to find what it
needs).
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-09 19:16 Craig Scott    New Issue                                    
======================================================================




More information about the cmake-developers mailing list