[Cmake-commits] CMake branch, next, updated. v2.8.12-4089-g067b033

Brad King brad.king at kitware.com
Thu Oct 17 08:45:34 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  067b033d8c79ad807c21e73efc49bcc5fdcb92bd (commit)
       via  aabf672a5a729f36d34809f97e5e502c40d68033 (commit)
      from  819d956ed877f010b7bb39678484f864f3eda22e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=067b033d8c79ad807c21e73efc49bcc5fdcb92bd
commit 067b033d8c79ad807c21e73efc49bcc5fdcb92bd
Merge: 819d956 aabf672
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 17 08:45:31 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 17 08:45:31 2013 -0400

    Merge topic 'vs-intel-compiler' into next
    
    aabf672 Intel: Fix VS plugin version lookup


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aabf672a5a729f36d34809f97e5e502c40d68033
commit aabf672a5a729f36d34809f97e5e502c40d68033
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 17 08:41:02 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 17 08:41:07 2013 -0400

    Intel: Fix VS plugin version lookup
    
    Perform the lookup on-demand instead of during construction because the
    vtable needed for GetIDEVersion is not ready during construction.

diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 6740be7..d476c24 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -21,7 +21,7 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
   const char* platformName)
 {
   this->FindMakeProgramFile = "CMakeVS7FindMake.cmake";
-  this->InitIntelProjectVersion();
+  this->IntelProjectVersion = 0;
 
   if (!platformName)
     {
@@ -30,35 +30,44 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
   this->PlatformName = platformName;
 }
 
+cmGlobalVisualStudio7Generator::~cmGlobalVisualStudio7Generator()
+{
+  free(this->IntelProjectVersion);
+}
+
 // Package GUID of Intel Visual Fortran plugin to VS IDE
 #define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
 
-void cmGlobalVisualStudio7Generator::InitIntelProjectVersion()
+const char* cmGlobalVisualStudio7Generator::GetIntelProjectVersion()
 {
-  // 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;
-  std::string vskey = this->GetRegistryBase();
-  vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
-  cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
-                                   cmSystemTools::KeyWOW64_32);
-  unsigned int intelVersionNumber = ~0u;
-  sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
-  if(intelVersionNumber >= 11)
-    {
-    // Default to latest known project file version.
-    intelVersion = "11.0";
-    }
-  else if(intelVersionNumber == 10)
-    {
-    // Version 10.x actually uses 9.10 in project files!
-    intelVersion = "9.10";
-    }
-  else
+  if(!this->IntelProjectVersion)
     {
-    // Version <= 9: use ProductVersion from registry.
+    // 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;
+    std::string vskey = this->GetRegistryBase();
+    vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
+    cmSystemTools::ReadRegistryValue(vskey.c_str(), intelVersion,
+                                     cmSystemTools::KeyWOW64_32);
+    unsigned int intelVersionNumber = ~0u;
+    sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
+    if(intelVersionNumber >= 11)
+      {
+      // Default to latest known project file version.
+      intelVersion = "11.0";
+      }
+    else if(intelVersionNumber == 10)
+      {
+      // Version 10.x actually uses 9.10 in project files!
+      intelVersion = "9.10";
+      }
+    else
+      {
+      // Version <= 9: use ProductVersion from registry.
+      }
+    this->IntelProjectVersion = strdup(intelVersion.c_str());
     }
-  this->IntelProjectVersion = intelVersion;
+  return this->IntelProjectVersion;
 }
 
 void cmGlobalVisualStudio7Generator
@@ -187,7 +196,7 @@ void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
   cmGlobalVisualStudioGenerator::AddPlatformDefinitions(mf);
   mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName());
   mf->AddDefinition("CMAKE_VS_INTEL_Fortran_PROJECT_VERSION",
-                    this->IntelProjectVersion.c_str());
+                    this->GetIntelProjectVersion());
 }
 
 void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index d586a6b..66dc443 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -27,6 +27,8 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
 {
 public:
   cmGlobalVisualStudio7Generator(const char* platformName = NULL);
+  ~cmGlobalVisualStudio7Generator();
+
   static cmGlobalGeneratorFactory* NewFactory() {
     return new cmGlobalGeneratorSimpleFactory
       <cmGlobalVisualStudio7Generator>(); }
@@ -101,8 +103,8 @@ public:
       LinkLibraryDependencies and link to .sln dependencies. */
   virtual bool NeedLinkLibraryDependencies(cmTarget&) { return false; }
 
-  std::string const& GetIntelProjectVersion() const
-    { return this->IntelProjectVersion; }
+  const char* GetIntelProjectVersion();
+
 protected:
   virtual const char* GetIDEVersion() { return "7.0"; }
 
@@ -163,8 +165,7 @@ protected:
   std::string PlatformName;
 
 private:
-  void InitIntelProjectVersion();
-  std::string IntelProjectVersion;
+  char* IntelProjectVersion;
 };
 
 #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalVisualStudio7Generator.cxx |   61 ++++++++++++++++------------
 Source/cmGlobalVisualStudio7Generator.h   |    9 ++--
 2 files changed, 40 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list