[Cmake-commits] CMake branch, next, updated. v3.7.0-1413-g57b72ac

Brad King brad.king at kitware.com
Tue Nov 29 11:04:49 EST 2016


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  57b72acd65db3dc86d326967ec0b1a304c57b6fe (commit)
       via  31e013ae6066067433676c21b8698256404d64f1 (commit)
       via  d639620e14cb25a3bc8039bc2a50bf402b8d2f79 (commit)
      from  d1565ff672b87389f023fdd1932f407428709e54 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57b72acd65db3dc86d326967ec0b1a304c57b6fe
commit 57b72acd65db3dc86d326967ec0b1a304c57b6fe
Merge: d1565ff 31e013a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 29 11:04:47 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 29 11:04:47 2016 -0500

    Merge topic 'vs15-rename-generator-for-master' into next
    
    31e013ae Merge branch 'vs15-rename-generator' into vs15-rename-generator-for-master
    d639620e VS: Rename VS 15 generator to 'Visual Studio 15 2017'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31e013ae6066067433676c21b8698256404d64f1
commit 31e013ae6066067433676c21b8698256404d64f1
Merge: 2f7e05f d639620
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 29 10:50:08 2016 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 29 10:51:35 2016 -0500

    Merge branch 'vs15-rename-generator' into vs15-rename-generator-for-master

diff --cc Help/generator/Visual Studio 15 2017.rst
index 2eb9052,18b0131..a88f8bc
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@@ -9,17 -9,8 +9,17 @@@ to specify a target platform name (arch
  For compatibility with CMake versions prior to 3.1, one may specify
  a target platform name optionally at the end of this generator name:
  
- ``Visual Studio 15 Win64``
+ ``Visual Studio 15 2017 Win64``
    Specify target platform ``x64``.
  
- ``Visual Studio 15 ARM``
+ ``Visual Studio 15 2017 ARM``
    Specify target platform ``ARM``.
 +
 +Toolset Selection
 +^^^^^^^^^^^^^^^^^
 +
- The ``v141`` toolset that comes with Visual Studio 15 is selected by
++The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
 +default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
 +via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
 +
 +.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --cc Source/cmGlobalVisualStudio15Generator.cxx
index 19b48df,0c6beb2..091a03e
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@@ -3,12 -3,10 +3,12 @@@
  #include "cmGlobalVisualStudio15Generator.h"
  
  #include "cmAlgorithms.h"
 +#include "cmDocumentationEntry.h"
  #include "cmLocalVisualStudio10Generator.h"
  #include "cmMakefile.h"
 +#include "cmVS141CLFlagTable.h"
  
- static const char vs15generatorName[] = "Visual Studio 15";
+ static const char vs15generatorName[] = "Visual Studio 15 2017";
  
  // Map generator name without year to name with year.
  static const char* cmVS15GenName(const std::string& name, std::string& genName)
diff --cc Source/cmake.cxx
index 59290ff,f0caf0d..733e0e4
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@@ -1440,63 -1485,6 +1440,63 @@@ int cmake::ActualConfigure(
    return 0;
  }
  
 +void cmake::CreateDefaultGlobalGenerator()
 +{
 +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
 +  std::string found;
 +  // Try to find the newest VS installed on the computer and
 +  // use that as a default if -G is not specified
 +  const std::string vsregBase = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\";
 +  static const char* const vsVariants[] = {
 +    /* clang-format needs this comment to break after the opening brace */
 +    "VisualStudio\\", "VCExpress\\", "WDExpress\\"
 +  };
 +  struct VSVersionedGenerator
 +  {
 +    const char* MSVersion;
 +    const char* GeneratorName;
 +  };
 +  static VSVersionedGenerator const vsGenerators[] = {
-     { "15.0", "Visual Studio 15" },      //
++    { "15.0", "Visual Studio 15 2017" }, //
 +    { "14.0", "Visual Studio 14 2015" }, //
 +    { "12.0", "Visual Studio 12 2013" }, //
 +    { "11.0", "Visual Studio 11 2012" }, //
 +    { "10.0", "Visual Studio 10 2010" }, //
 +    { "9.0", "Visual Studio 9 2008" },   //
 +    { "8.0", "Visual Studio 8 2005" },   //
 +    { "7.1", "Visual Studio 7 .NET 2003" }
 +  };
 +  static const char* const vsEntries[] = {
 +    "\\Setup\\VC;ProductDir", //
 +    ";InstallDir"             //
 +  };
 +  for (VSVersionedGenerator const* g = cmArrayBegin(vsGenerators);
 +       found.empty() && g != cmArrayEnd(vsGenerators); ++g) {
 +    for (const char* const* v = cmArrayBegin(vsVariants);
 +         found.empty() && v != cmArrayEnd(vsVariants); ++v) {
 +      for (const char* const* e = cmArrayBegin(vsEntries);
 +           found.empty() && e != cmArrayEnd(vsEntries); ++e) {
 +        std::string const reg = vsregBase + *v + g->MSVersion + *e;
 +        std::string dir;
 +        if (cmSystemTools::ReadRegistryValue(reg, dir,
 +                                             cmSystemTools::KeyWOW64_32) &&
 +            cmSystemTools::PathExists(dir)) {
 +          found = g->GeneratorName;
 +        }
 +      }
 +    }
 +  }
 +  cmGlobalGenerator* gen = this->CreateGlobalGenerator(found);
 +  if (!gen) {
 +    gen = new cmGlobalNMakeMakefileGenerator(this);
 +  }
 +  this->SetGlobalGenerator(gen);
 +  std::cout << "-- Building for: " << gen->GetName() << "\n";
 +#else
 +  this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator3(this));
 +#endif
 +}
 +
  void cmake::PreLoadCMakeFiles()
  {
    std::vector<std::string> args;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d639620e14cb25a3bc8039bc2a50bf402b8d2f79
commit d639620e14cb25a3bc8039bc2a50bf402b8d2f79
Author:     Roman Wüger <roman.wueger at gmx.at>
AuthorDate: Tue Nov 29 13:50:21 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 29 10:46:36 2016 -0500

    VS: Rename VS 15 generator to 'Visual Studio 15 2017'
    
    The final name of this VS version was announced:
    
     https://blogs.msdn.microsoft.com/visualstudio/2016/11/16/visual-studio-2017-rc/
    
    Add the year to the generator name accordingly.  For convenience, map
    the name without the year to the name with the year.

diff --git a/Help/generator/Visual Studio 15.rst b/Help/generator/Visual Studio 15 2017.rst
similarity index 67%
rename from Help/generator/Visual Studio 15.rst
rename to Help/generator/Visual Studio 15 2017.rst
index ae456eb..18b0131 100644
--- a/Help/generator/Visual Studio 15.rst	
+++ b/Help/generator/Visual Studio 15 2017.rst	
@@ -1,7 +1,7 @@
-Visual Studio 15
-----------------
+Visual Studio 15 2017
+---------------------
 
-Generates Visual Studio 15 project files.
+Generates Visual Studio 15 (VS 2017) project files.
 
 The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
 to specify a target platform name (architecture).
@@ -9,8 +9,8 @@ to specify a target platform name (architecture).
 For compatibility with CMake versions prior to 3.1, one may specify
 a target platform name optionally at the end of this generator name:
 
-``Visual Studio 15 Win64``
+``Visual Studio 15 2017 Win64``
   Specify target platform ``x64``.
 
-``Visual Studio 15 ARM``
+``Visual Studio 15 2017 ARM``
   Specify target platform ``ARM``.
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 3df3a81..a37c65b 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -82,7 +82,7 @@ Visual Studio Generators
    /generator/Visual Studio 11 2012
    /generator/Visual Studio 12 2013
    /generator/Visual Studio 14 2015
-   /generator/Visual Studio 15
+   /generator/Visual Studio 15 2017
 
 Other Generators
 ^^^^^^^^^^^^^^^^
diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst
index 3b8ade6..4c51af4 100644
--- a/Help/release/3.7.rst
+++ b/Help/release/3.7.rst
@@ -31,9 +31,9 @@ Generators
   This is equivalent to ``cd sub/dir; make {test,install,package}``
   with :ref:`Makefile Generators`.
 
-* The :generator:`Visual Studio 15` generator was added.  This is
-  experimental and based on Preview 5 because this version of VS
-  has not been released.
+* The :generator:`Visual Studio 15 2017` generator was added.  This is
+  experimental and based on "Visual Studio 2017 RC" because this version
+  of VS has not been released.
 
 * :ref:`Visual Studio Generators` for VS 2010 and above learned to
   place ``.natvis`` source files into VS project files properly.
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
index a833a5f..0c6beb2 100644
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@ -6,16 +6,19 @@
 #include "cmLocalVisualStudio10Generator.h"
 #include "cmMakefile.h"
 
-static const char vs15generatorName[] = "Visual Studio 15";
+static const char vs15generatorName[] = "Visual Studio 15 2017";
 
 // Map generator name without year to name with year.
 static const char* cmVS15GenName(const std::string& name, std::string& genName)
 {
   if (strncmp(name.c_str(), vs15generatorName,
-              sizeof(vs15generatorName) - 1) != 0) {
+              sizeof(vs15generatorName) - 6) != 0) {
     return 0;
   }
-  const char* p = name.c_str() + sizeof(vs15generatorName) - 1;
+  const char* p = name.c_str() + sizeof(vs15generatorName) - 6;
+  if (cmHasLiteralPrefix(p, " 2017")) {
+    p += 5;
+  }
   genName = std::string(vs15generatorName) + p;
   return p;
 }
@@ -50,7 +53,7 @@ public:
   virtual void GetDocumentation(cmDocumentationEntry& entry) const
   {
     entry.Name = std::string(vs15generatorName) + " [arch]";
-    entry.Brief = "Generates Visual Studio 15 project files.  "
+    entry.Brief = "Generates Visual Studio 2017 project files.  "
                   "Optional [arch] can be \"Win64\" or \"ARM\".";
   }
 
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c8cf465..f0caf0d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1334,7 +1334,7 @@ int cmake::ActualConfigure()
         { "11.0", "Visual Studio 11 2012" },
         { "12.0", "Visual Studio 12 2013" },
         { "14.0", "Visual Studio 14 2015" },
-        { "15.0", "Visual Studio 15" },
+        { "15.0", "Visual Studio 15 2017" },
         { 0, 0 }
       };
       for (int i = 0; version[i].MSVersion != 0; i++) {

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

Summary of changes:
 .../{Visual Studio 15.rst => Visual Studio 15 2017.rst}    |   12 ++++++------
 Help/manual/cmake-generators.7.rst                         |    2 +-
 Help/release/3.7.rst                                       |    6 +++---
 Source/cmGlobalVisualStudio15Generator.cxx                 |   11 +++++++----
 Source/cmake.cxx                                           |    2 +-
 5 files changed, 18 insertions(+), 15 deletions(-)
 rename Help/generator/{Visual Studio 15.rst => Visual Studio 15 2017.rst} (70%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list