summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-02-07 20:33:23 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-02-07 20:33:23 (GMT)
commit941d533cc31cacde79e8fb3a6b61f0e93ccc3740 (patch)
tree5cd825578441eef6d831ba4e1bbf5f804b7a33f5 /Source
parent6c7a622279a8d02cd01b7c19d7eb3091b3765a23 (diff)
parentde289462efc070d831bf5e49d63fb47e1de57769 (diff)
downloadCMake-941d533cc31cacde79e8fb3a6b61f0e93ccc3740.zip
CMake-941d533cc31cacde79e8fb3a6b61f0e93ccc3740.tar.gz
CMake-941d533cc31cacde79e8fb3a6b61f0e93ccc3740.tar.bz2
Merge topic 'find-vcexpress'
de28946 Find VC Express during default generator selection (#12917)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d691f46..c0c73d6 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2204,8 +2204,11 @@ int cmake::ActualConfigure()
std::string installedCompiler;
// Try to find the newest VS installed on the computer and
// use that as a default if -G is not specified
- std::string vsregBase =
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
+ const std::string vsregBase =
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\";
+ std::vector<std::string> vsVerions;
+ vsVerions.push_back("VisualStudio\\");
+ vsVerions.push_back("VCExpress\\");
struct VSRegistryEntryName
{
const char* MSVersion;
@@ -2219,14 +2222,18 @@ int cmake::ActualConfigure()
{"9.0", "Visual Studio 9 2008"},
{"10.0", "Visual Studio 10"},
{0, 0}};
- for(int i =0; version[i].MSVersion != 0; i++)
+ for(size_t b=0; b < vsVerions.size() && installedCompiler.empty(); b++)
{
- std::string reg = vsregBase + version[i].MSVersion;
- reg += ";InstallDir]";
- cmSystemTools::ExpandRegistryValues(reg);
- if (!(reg == "/registry"))
+ for(int i =0; version[i].MSVersion != 0; i++)
{
- installedCompiler = version[i].GeneratorName;
+ std::string reg = vsregBase + vsVerions[b] + version[i].MSVersion;
+ reg += ";InstallDir]";
+ cmSystemTools::ExpandRegistryValues(reg,
+ cmSystemTools::KeyWOW64_32);
+ if (!(reg == "/registry"))
+ {
+ installedCompiler = version[i].GeneratorName;
+ }
}
}
cmGlobalGenerator* gen