summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-16 15:44:50 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-16 15:44:50 (GMT)
commit2006e4a4050871429e492ab883be0033d6add9a8 (patch)
treea926cd4d332152a6d84d8d1ede56f2d3b05de2e4 /Source
parent09e398fa9f6e2a858780c78e3096a56e96a3dcb7 (diff)
downloadCMake-2006e4a4050871429e492ab883be0033d6add9a8.zip
CMake-2006e4a4050871429e492ab883be0033d6add9a8.tar.gz
CMake-2006e4a4050871429e492ab883be0033d6add9a8.tar.bz2
Generate proper Intel Fortran project version
The Intel Visual Fortran compiler plugin for MS Visual Studio may be one of several versions of the Intel compiler. This commit teaches CMake to detect the plugin version and set the version number in .vfproj files. See issue #9169.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 855c2e3..5fc00f0 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -31,6 +31,9 @@
#include <ctype.h> // for isspace
+// Package GUID of Intel Visual Fortran plugin to VS IDE
+#define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
+
static bool cmLVS6G_IsFAT(const char* dir);
class cmLocalVisualStudio7GeneratorInternals
@@ -1675,10 +1678,19 @@ cmLocalVisualStudio7Generator
cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
+
+ // Compute the version of the Intel plugin to the VS IDE.
+ // If the key does not exist then use a default guess.
+ std::string intelVersion = "9.10";
+ std::string vskey = gg->GetRegistryBase();
+ vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
+ cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
+ cmSystemTools::KeyWOW64_32);
+
fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
<< "<VisualStudioProject\n"
<< "\tProjectCreator=\"Intel Fortran\"\n"
- << "\tVersion=\"9.10\"\n";
+ << "\tVersion=\"" << intelVersion << "\"\n";
const char* keyword = target.GetProperty("VS_KEYWORD");
if(!keyword)
{