[Cmake-commits] CMake branch, master, updated. v3.11.1-770-gc9e995c

Kitware Robot kwrobot at kitware.com
Fri May 11 09:25:12 EDT 2018


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, master has been updated
       via  c9e995c9efdaa462ac2649f1c1ff4e511db7fcf5 (commit)
       via  d54796cbd9d8794866525d5d58c573557d5fe610 (commit)
       via  1dda570edc5bbb004d8561d796cdd489af741234 (commit)
       via  9912d2655a7c7e1f77d8341c6640801b5e2bbe0c (commit)
       via  1e521a1a91291b4ac6400c7f37345fcdb423d793 (commit)
       via  c747d4ccb349f87963a8d1da69394bc4db6b74ed (commit)
       via  4f0c5d3775ff4682bf6c6794d017ab278c141016 (commit)
       via  e567d7eb639b43c2256340acdf4b0053dec0018a (commit)
       via  53ffff2277c4d37380d4a55d4e251face8766d14 (commit)
       via  91754b4e6026974e6264329ec1fad478ced3cc6f (commit)
       via  a2b5acec3bf93287eff6276e8ba3b5a4ad4f1a88 (commit)
       via  b28e093f6a1688c90462ca575efd19f52f2a2bdc (commit)
       via  81cc993f89d4287807fb87fc094ce45d2a316c56 (commit)
       via  557e68e1a3d73dd0878479b29e9d58836409e01d (commit)
      from  ad83aa0f3d97ab9a02a14e0cd9f85f5cab2b2668 (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=c9e995c9efdaa462ac2649f1c1ff4e511db7fcf5
commit c9e995c9efdaa462ac2649f1c1ff4e511db7fcf5
Merge: d54796c a2b5ace
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 13:23:06 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri May 11 09:23:13 2018 -0400

    Merge topic 'vs-refactor'
    
    a2b5acec3b cmVisualStudio10TargetGenerator: refactor
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2054


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d54796cbd9d8794866525d5d58c573557d5fe610
commit d54796cbd9d8794866525d5d58c573557d5fe610
Merge: 1dda570 53ffff2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 13:21:50 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri May 11 09:22:01 2018 -0400

    Merge topic 'FindCUDA-sccache'
    
    53ffff2277 FindCUDA: Add support for sccache
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2050


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1dda570edc5bbb004d8561d796cdd489af741234
commit 1dda570edc5bbb004d8561d796cdd489af741234
Merge: 9912d26 91754b4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 13:20:32 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri May 11 09:20:49 2018 -0400

    Merge topic 'vs-fix-csharp-recompile'
    
    91754b4e60 VS: When not referencing output assembly do not try to copy it either
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2037

diff --cc Source/cmVisualStudio10TargetGenerator.cxx
index cfdf2d8,18ec7bf..494e574
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@@ -3790,25 -3803,20 +3790,26 @@@ void cmVisualStudio10TargetGenerator::W
        // If the dependency target is not managed (compiled with /clr or
        // C# target) we cannot reference it and have to set
        // 'ReferenceOutputAssembly' to false.
 -      cmGeneratorTarget::ManagedType check =
 -        cmGeneratorTarget::ManagedType::Mixed;
 -      // FIXME: These (5) lines should be removed. They are here to allow
 -      //        manual setting of the /clr flag in compiler options. Setting
 -      //        /clr manually makes cmGeneratorTarget::GetManagedType() return
 -      //        'Native' instead of 'Mixed' or 'Managed'.
 -      check = cmGeneratorTarget::ManagedType::Native;
 -      bool unmanagedStatic = false;
 -      if (dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
 -        unmanagedStatic = !dt->HasLanguage("CSharp", "");
 -      }
 -      if (dt->GetManagedType("") < check || unmanagedStatic) {
 +      auto referenceNotManaged =
 +        dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed;
 +      // Workaround to check for manually set /clr flags.
 +      if (referenceNotManaged) {
 +        if (const auto* flags = dt->GetProperty("COMPILE_OPTIONS")) {
 +          std::string flagsStr = flags;
 +          if (flagsStr.find("clr") != std::string::npos) {
 +            // There is a warning already issued when building the flags.
 +            referenceNotManaged = false;
 +          }
 +        }
 +      }
 +      // Workaround for static library C# targets
 +      if (referenceNotManaged &&
 +          dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
 +        referenceNotManaged = !dt->HasLanguage("CSharp", "");
 +      }
 +      if (referenceNotManaged) {
          e2.Element("ReferenceOutputAssembly", "false");
+         e2.Element("CopyToOutputDirectory", "Never");
        }
      }
      e2.EndElement();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9912d2655a7c7e1f77d8341c6640801b5e2bbe0c
commit 9912d2655a7c7e1f77d8341c6640801b5e2bbe0c
Merge: 1e521a1 4f0c5d3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 09:19:09 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri May 11 09:19:09 2018 -0400

    Merge branch 'release-3.11'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e521a1a91291b4ac6400c7f37345fcdb423d793
commit 1e521a1a91291b4ac6400c7f37345fcdb423d793
Merge: c747d4c e567d7e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 13:17:05 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri May 11 09:18:08 2018 -0400

    Merge topic 'restore-imported-lib-alias-diagnostic'
    
    e567d7eb63 add_library: Restore error on alias of non-global imported target
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2058


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c747d4ccb349f87963a8d1da69394bc4db6b74ed
commit c747d4ccb349f87963a8d1da69394bc4db6b74ed
Merge: ad83aa0 81cc993
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 11 13:16:51 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri May 11 09:17:02 2018 -0400

    Merge topic 'FindBoost-backport-python-deps'
    
    81cc993f89 FindBoost: Backport versioned python dependencies for v1.35 to v1.66
    557e68e1a3 FindBoost: Remove extra indentation in 1.65/1.66 dependency block
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2045


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53ffff2277c4d37380d4a55d4e251face8766d14
commit 53ffff2277c4d37380d4a55d4e251face8766d14
Author:     Will Feng <willfeng at fb.com>
AuthorDate: Mon May 7 14:34:32 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed May 9 08:24:22 2018 -0400

    FindCUDA: Add support for sccache
    
    When `CMAKE_C_COMPILER` is `sccache`, pass plain `cl` as the host
    compiler to `nvcc`.  Otherwise, `nvcc` does not accept it.

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index a0e4aa9..82c44fc 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -557,10 +557,10 @@ else()
       set(c_compiler_realpath "")
     endif()
     set(CUDA_HOST_COMPILER "${c_compiler_realpath}" CACHE FILEPATH "Host side compiler used by NVCC")
-  elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache")
-    # NVCC does not think it will work if it is passed clcache.exe as the host
-    # compiler, which means that builds with CC=cl.exe won't work.  Best to just
-    # feed it whatever the actual cl.exe is as the host compiler.
+  elseif(MSVC AND "${CMAKE_C_COMPILER}" MATCHES "clcache|sccache")
+    # NVCC does not think it will work if it is passed clcache.exe or sccache.exe
+    # as the host compiler, which means that builds with CC=cl.exe won't work.
+    # Best to just feed it whatever the actual cl.exe is as the host compiler.
     set(CUDA_HOST_COMPILER "cl.exe" CACHE FILEPATH "Host side compiler used by NVCC")
   else()
     set(CUDA_HOST_COMPILER "${CMAKE_C_COMPILER}"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91754b4e6026974e6264329ec1fad478ced3cc6f
commit 91754b4e6026974e6264329ec1fad478ced3cc6f
Author:     Andreas Schönle <a.schoenle at abberior-instruments.com>
AuthorDate: Thu May 3 19:39:54 2018 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed May 9 08:17:42 2018 -0400

    VS: When not referencing output assembly do not try to copy it either
    
    When generating a `ProjectReference` with `ReferenceOutputAssembly` set
    to `false`, also set `CopyToOutputDirectory` to `Never`.  Otherwise
    MSBuild might report a diagnostic like
    
        Project '<name>' is not up to date.
        CopyLocal reference '...\ZERO_CHECK' is missing from output location.
    
    and rebuild the referencing project unnecessarily.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2e8a2eb..18ec7bf 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3816,6 +3816,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
       }
       if (dt->GetManagedType("") < check || unmanagedStatic) {
         e2.Element("ReferenceOutputAssembly", "false");
+        e2.Element("CopyToOutputDirectory", "Never");
       }
     }
     e2.EndElement();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2b5acec3bf93287eff6276e8ba3b5a4ad4f1a88
commit a2b5acec3bf93287eff6276e8ba3b5a4ad4f1a88
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Tue May 8 11:17:00 2018 -0400
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Wed May 9 08:04:34 2018 -0400

    cmVisualStudio10TargetGenerator: refactor
    
    `WritePlatformConfigTag` moved to local `Elem` class; other improvements

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index cfdf2d8..02dbc59 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -103,6 +103,9 @@ struct cmVisualStudio10TargetGenerator::Elem
     }
   }
   void EndElement() { this->WriteEndTag(this->Tag); }
+
+  void WritePlatformConfigTag(const char* tag, const std::string& cond,
+                              const std::string& content);
 };
 
 class cmVS10GeneratorOptions : public cmVisualStudioGeneratorOptions
@@ -123,10 +126,11 @@ public:
     if (!this->GetConfiguration().empty()) {
       // if there are configuration specific flags, then
       // use the configuration specific tag for PreprocessorDefinitions
-      this->TargetGenerator->WritePlatformConfigTag(
-        tag, this->GetConfiguration(), *Parent, content);
+      const std::string cond =
+        this->TargetGenerator->CalcCondition(this->GetConfiguration());
+      this->Parent->WritePlatformConfigTag(tag, cond, content);
     } else {
-      Parent->Element(tag, content);
+      this->Parent->Element(tag, content);
     }
   }
 
@@ -268,13 +272,10 @@ std::string cmVisualStudio10TargetGenerator::CalcCondition(
   return oss.str();
 }
 
-void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
-  const char* tag, const std::string& config, Elem& parent,
-  const std::string& content)
+void cmVisualStudio10TargetGenerator::Elem::WritePlatformConfigTag(
+  const char* tag, const std::string& cond, const std::string& content)
 {
-  Elem(parent, tag)
-    .Attribute("Condition", this->CalcCondition(config))
-    .Content(content);
+  Elem(*this, tag).Attribute("Condition", cond).Content(content);
 }
 
 std::ostream& cmVisualStudio10TargetGenerator::Elem::WriteString(
@@ -288,12 +289,6 @@ std::ostream& cmVisualStudio10TargetGenerator::Elem::WriteString(
   return this->S;
 }
 
-void cmVisualStudio10TargetGenerator::WriteString(const char* line,
-                                                  int indentLevel)
-{
-  Elem(*this->BuildFileStream, indentLevel).WriteString(line);
-}
-
 #define VS10_CXX_DEFAULT_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.Default.props"
 #define VS10_CXX_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.props"
 #define VS10_CXX_USER_PROPS                                                   \
@@ -689,17 +684,19 @@ void cmVisualStudio10TargetGenerator::Generate()
     }
     // make sure custom commands are executed before build (if necessary)
     Elem e1(e0, "PropertyGroup");
-    e1.SetHasElements();
-    this->WriteString("<BuildDependsOn>\n", 2);
-    for (std::string const& i : this->CSharpCustomCommandNames) {
-      this->WriteString(i.c_str(), 3);
-      (*this->BuildFileStream) << ";\n";
+    {
+      std::ostringstream oss;
+      oss << "\n";
+      for (std::string const& i : this->CSharpCustomCommandNames) {
+        oss << "      " << i << ";\n";
+      }
+      oss << "      "
+          << "$(BuildDependsOn)\n";
+      e1.Element("BuildDependsOn", oss.str());
     }
-    this->WriteString("$(BuildDependsOn)\n", 3);
-    this->WriteString("</BuildDependsOn>\n", 2);
     e1.EndElement();
   }
-  this->WriteString("</Project>", 0);
+  e0.WriteString("</Project>");
   // The groups are stored in a separate file for VS 10
   this->WriteGroups();
 }
@@ -844,7 +841,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup(Elem& e0)
             s = "$(RootNamespace).";
           }
           s += "%(Filename).resources";
-          this->WritePlatformConfigTag("LogicalName", i, e2, s);
+          e2.WritePlatformConfigTag("LogicalName", CalcCondition(i), s);
         }
       } else {
         std::string binDir = this->Makefile->GetCurrentBinaryDirectory();
@@ -1336,16 +1333,15 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp(
   std::string const& comment)
 {
   const std::string cond = this->CalcCondition(config);
-  Elem(e2, "Message").Attribute("Condition", cond).Content(comment);
-  Elem(e2, "Command").Attribute("Condition", cond).Content(script);
-  Elem(e2, "AdditionalInputs")
-    .Attribute("Condition", cond)
-    .Content(inputs + ";%(AdditionalInputs)");
-  Elem(e2, "Outputs").Attribute("Condition", cond).Content(outputs);
+  e2.WritePlatformConfigTag("Message", cond, comment);
+  e2.WritePlatformConfigTag("Command", cond, script);
+  e2.WritePlatformConfigTag("AdditionalInputs", cond,
+                            inputs + ";%(AdditionalInputs)");
+  e2.WritePlatformConfigTag("Outputs", cond, outputs);
   if (this->LocalGenerator->GetVersion() >
       cmGlobalVisualStudioGenerator::VS10) {
     // VS >= 11 let us turn off linking of custom command outputs.
-    Elem(e2, "LinkObjects").Attribute("Condition", cond).Content("false");
+    e2.WritePlatformConfigTag("LinkObjects", cond, "false");
   }
 }
 
@@ -1774,15 +1770,15 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
         if (0 == strcmp(cge->Evaluate(this->LocalGenerator,
                                       this->Configurations[i]),
                         "1")) {
-          Elem e3(e2, "DeploymentContent");
-          e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                         this->Configurations[i] + "|" + this->Platform + "'");
-          e3.Content("true");
+          e2.WritePlatformConfigTag(
+            "DeploymentContent", "'$(Configuration)|$(Platform)'=='" +
+              this->Configurations[i] + "|" + this->Platform + "'",
+            "true");
         } else {
-          Elem e3(e2, "ExcludedFromBuild");
-          e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                         this->Configurations[i] + "|" + this->Platform + "'");
-          e3.Content("true");
+          e2.WritePlatformConfigTag(
+            "ExcludedFromBuild", "'$(Configuration)|$(Platform)'=='" +
+              this->Configurations[i] + "|" + this->Platform + "'",
+            "true");
         }
       }
     }
@@ -1797,18 +1793,18 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
     }
     if (!outputHeaderFile.empty()) {
       for (size_t i = 0; i != this->Configurations.size(); ++i) {
-        Elem e3(e2, "HeaderFileOutput");
-        e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                       this->Configurations[i] + "|" + this->Platform + "'");
-        e3.Content(outputHeaderFile);
+        e2.WritePlatformConfigTag(
+          "HeaderFileOutput", "'$(Configuration)|$(Platform)'=='" +
+            this->Configurations[i] + "|" + this->Platform + "'",
+          outputHeaderFile);
       }
     }
     if (!variableName.empty()) {
       for (size_t i = 0; i != this->Configurations.size(); ++i) {
-        Elem e3(e2, "VariableName");
-        e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                       this->Configurations[i] + "|" + this->Platform + "'");
-        e3.Content(variableName);
+        e2.WritePlatformConfigTag(
+          "VariableName", "'$(Configuration)|$(Platform)'=='" +
+            this->Configurations[i] + "|" + this->Platform + "'",
+          variableName);
       }
     }
     if (!shaderEnableDebug.empty()) {
@@ -1820,10 +1816,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
         const char* enableDebug =
           cge->Evaluate(this->LocalGenerator, this->Configurations[i]);
         if (strlen(enableDebug) > 0) {
-          Elem e3(e2, "EnableDebuggingInformation");
-          e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                         this->Configurations[i] + "|" + this->Platform + "'");
-          e3.Content(cmSystemTools::IsOn(enableDebug) ? "true" : "false");
+          e2.WritePlatformConfigTag(
+            "EnableDebuggingInformation", "'$(Configuration)|$(Platform)'=='" +
+              this->Configurations[i] + "|" + this->Platform + "'",
+            cmSystemTools::IsOn(enableDebug) ? "true" : "false");
         }
       }
     }
@@ -1836,11 +1832,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
         const char* disableOptimizations =
           cge->Evaluate(this->LocalGenerator, this->Configurations[i]);
         if (strlen(disableOptimizations) > 0) {
-          Elem e3(e2, "DisableOptimizations");
-          e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                         this->Configurations[i] + "|" + this->Platform + "'");
-          e3.Content(cmSystemTools::IsOn(disableOptimizations) ? "true"
-                                                               : "false");
+          e2.WritePlatformConfigTag(
+            "DisableOptimizations", "'$(Configuration)|$(Platform)'=='" +
+              this->Configurations[i] + "|" + this->Platform + "'",
+            (cmSystemTools::IsOn(disableOptimizations) ? "true" : "false"));
         }
       }
     }
@@ -2225,10 +2220,10 @@ void cmVisualStudio10TargetGenerator::WriteExcludeFromBuild(
   Elem& e2, std::vector<size_t> const& exclude_configs)
 {
   for (size_t ci : exclude_configs) {
-    Elem e3(e2, "ExcludedFromBuild");
-    e3.Attribute("Condition", "'$(Configuration)|$(Platform)'=='" +
-                   this->Configurations[ci] + "|" + this->Platform + "'");
-    e3.Content("true");
+    e2.WritePlatformConfigTag(
+      "ExcludedFromBuild", "'$(Configuration)|$(Platform)'=='" +
+        this->Configurations[ci] + "|" + this->Platform + "'",
+      "true");
   }
 }
 
@@ -2246,10 +2241,10 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
   Elem e1(e0, "PropertyGroup");
   e1.Element("_ProjectFileVersion", "10.0.20506.1");
   for (std::string const& config : this->Configurations) {
+    const std::string cond = this->CalcCondition(config);
     if (ttype >= cmStateEnums::UTILITY) {
-      this->WritePlatformConfigTag(
-        "IntDir", config, e1,
-        "$(Platform)\\$(Configuration)\\$(ProjectName)\\");
+      e1.WritePlatformConfigTag(
+        "IntDir", cond, "$(Platform)\\$(Configuration)\\$(ProjectName)\\");
     } else {
       std::string intermediateDir =
         this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
@@ -2269,67 +2264,63 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
       ConvertToWindowsSlash(intermediateDir);
       ConvertToWindowsSlash(outDir);
 
-      this->WritePlatformConfigTag("OutDir", config, e1, outDir);
+      e1.WritePlatformConfigTag("OutDir", cond, outDir);
 
-      this->WritePlatformConfigTag("IntDir", config, e1, intermediateDir);
+      e1.WritePlatformConfigTag("IntDir", cond, intermediateDir);
 
       if (const char* sdkExecutableDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES")) {
-        this->WritePlatformConfigTag("ExecutablePath", config, e1,
-                                     sdkExecutableDirectories);
+        e1.WritePlatformConfigTag("ExecutablePath", cond,
+                                  sdkExecutableDirectories);
       }
 
       if (const char* sdkIncludeDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_INCLUDE_DIRECTORIES")) {
-        this->WritePlatformConfigTag("IncludePath", config, e1,
-                                     sdkIncludeDirectories);
+        e1.WritePlatformConfigTag("IncludePath", cond, sdkIncludeDirectories);
       }
 
       if (const char* sdkReferenceDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_REFERENCE_DIRECTORIES")) {
-        this->WritePlatformConfigTag("ReferencePath", config, e1,
-                                     sdkReferenceDirectories);
+        e1.WritePlatformConfigTag("ReferencePath", cond,
+                                  sdkReferenceDirectories);
       }
 
       if (const char* sdkLibraryDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_LIBRARY_DIRECTORIES")) {
-        this->WritePlatformConfigTag("LibraryPath", config, e1,
-                                     sdkLibraryDirectories);
+        e1.WritePlatformConfigTag("LibraryPath", cond, sdkLibraryDirectories);
       }
 
       if (const char* sdkLibraryWDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES")) {
-        this->WritePlatformConfigTag("LibraryWPath", config, e1,
-                                     sdkLibraryWDirectories);
+        e1.WritePlatformConfigTag("LibraryWPath", cond,
+                                  sdkLibraryWDirectories);
       }
 
       if (const char* sdkSourceDirectories =
             this->Makefile->GetDefinition("CMAKE_VS_SDK_SOURCE_DIRECTORIES")) {
-        this->WritePlatformConfigTag("SourcePath", config, e1,
-                                     sdkSourceDirectories);
+        e1.WritePlatformConfigTag("SourcePath", cond, sdkSourceDirectories);
       }
 
       if (const char* sdkExcludeDirectories = this->Makefile->GetDefinition(
             "CMAKE_VS_SDK_EXCLUDE_DIRECTORIES")) {
-        this->WritePlatformConfigTag("ExcludePath", config, e1,
-                                     sdkExcludeDirectories);
+        e1.WritePlatformConfigTag("ExcludePath", cond, sdkExcludeDirectories);
       }
 
       if (const char* workingDir = this->GeneratorTarget->GetProperty(
             "VS_DEBUGGER_WORKING_DIRECTORY")) {
-        this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory", config,
-                                     e1, workingDir);
+        e1.WritePlatformConfigTag("LocalDebuggerWorkingDirectory", cond,
+                                  workingDir);
       }
 
       if (const char* debuggerCommand =
             this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) {
-        this->WritePlatformConfigTag("LocalDebuggerCommand", config, e1,
-                                     debuggerCommand);
+        e1.WritePlatformConfigTag("LocalDebuggerCommand", cond,
+                                  debuggerCommand);
       }
 
       std::string name =
         cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
-      this->WritePlatformConfigTag("TargetName", config, e1, name);
+      e1.WritePlatformConfigTag("TargetName", cond, name);
 
       std::string ext =
         cmSystemTools::GetFilenameLastExtension(targetNameFull);
@@ -2338,7 +2329,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
         // A single "." appears to be treated as an empty extension.
         ext = ".";
       }
-      this->WritePlatformConfigTag("TargetExt", config, e1, ext);
+      e1.WritePlatformConfigTag("TargetExt", cond, ext);
 
       this->OutputLinkIncremental(e1, config);
     }
@@ -2362,15 +2353,16 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
     return;
   }
   Options& linkOptions = *(this->LinkOptions[configName]);
+  const std::string cond = this->CalcCondition(configName);
 
   const char* incremental = linkOptions.GetFlag("LinkIncremental");
-  this->WritePlatformConfigTag("LinkIncremental", configName, e1,
-                               (incremental ? incremental : "true"));
+  e1.WritePlatformConfigTag("LinkIncremental", cond,
+                            (incremental ? incremental : "true"));
   linkOptions.RemoveFlag("LinkIncremental");
 
   const char* manifest = linkOptions.GetFlag("GenerateManifest");
-  this->WritePlatformConfigTag("GenerateManifest", configName, e1,
-                               (manifest ? manifest : "true"));
+  e1.WritePlatformConfigTag("GenerateManifest", cond,
+                            (manifest ? manifest : "true"));
   linkOptions.RemoveFlag("GenerateManifest");
 
   // Some link options belong here.  Use them now and remove them so that
@@ -2379,7 +2371,7 @@ void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
   for (const char** f = flags; *f; ++f) {
     const char* flag = *f;
     if (const char* value = linkOptions.GetFlag(flag)) {
-      this->WritePlatformConfigTag(flag, configName, e1, value);
+      e1.WritePlatformConfigTag(flag, cond, value);
       linkOptions.RemoveFlag(flag);
     }
   }
@@ -3839,24 +3831,17 @@ void cmVisualStudio10TargetGenerator::WritePlatformExtensions(Elem& e1)
 void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
   Elem& e1, std::string const& extension, std::string const& version)
 {
+  const std::string s = "$([Microsoft.Build.Utilities.ToolLocationHelper]"
+                        "::GetPlatformExtensionSDKLocation(`" +
+    extension + ", Version=" + version +
+    "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
+    "$(ExtensionSDKDirectoryRoot), null))"
+    "\\DesignTime\\CommonConfiguration\\Neutral\\" +
+    extension + ".props";
+
   Elem e2(e1, "Import");
-  e2.Attribute(
-    "Project", "$([Microsoft.Build.Utilities.ToolLocationHelper]"
-               "::GetPlatformExtensionSDKLocation(`" +
-      extension + ", Version=" + version +
-      "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
-      "$(ExtensionSDKDirectoryRoot), null))"
-      "\\DesignTime\\CommonConfiguration\\Neutral\\" +
-      extension + ".props");
-  e2.Attribute(
-    "Condition", "exists('$("
-                 "[Microsoft.Build.Utilities.ToolLocationHelper]"
-                 "::GetPlatformExtensionSDKLocation(`" +
-      extension + ", Version=" + version +
-      "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
-      "$(ExtensionSDKDirectoryRoot), null))"
-      "\\DesignTime\\CommonConfiguration\\Neutral\\" +
-      extension + ".props')");
+  e2.Attribute("Project", s);
+  e2.Attribute("Condition", "exists('" + s + "')");
   e2.EndElement();
 }
 
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 38c7725..8c0b6ca 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -53,10 +53,7 @@ private:
   struct OptionsHelper;
 
   std::string ConvertPath(std::string const& path, bool forceRelative);
-  void WriteString(const char* line, int indentLevel);
   std::string CalcCondition(const std::string& config) const;
-  void WritePlatformConfigTag(const char* tag, const std::string& config,
-                              Elem& parent, const std::string& content);
   void WriteProjectConfigurations(Elem& e0);
   void WriteProjectConfigurationValues(Elem& e0);
   void WriteMSToolConfigurationValues(Elem& e1, std::string const& config);

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

Summary of changes:
 Help/release/3.11.rst                              |    9 +
 Modules/FindBoost.cmake                            |   68 +++----
 Modules/FindCUDA.cmake                             |    8 +-
 Source/cmAddLibraryCommand.cxx                     |    8 +
 Source/cmVisualStudio10TargetGenerator.cxx         |  200 +++++++++-----------
 Source/cmVisualStudio10TargetGenerator.h           |    3 -
 .../alias_targets/imported-target-stderr.txt       |   10 +-
 7 files changed, 156 insertions(+), 150 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list