[Cmake-commits] CMake branch, next, updated. v3.6.1-1531-g738e3e9

Stephen Kelly steveire at gmail.com
Sat Aug 27 07:45:33 EDT 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  738e3e9d9af191e7f118e182bb3ba3690430e2af (commit)
       via  6ad153786f119e994662c2ec05059cdf46d9dbad (commit)
       via  a11a408a6edcb956fe9ba7a141cfbfd8e94078d6 (commit)
       via  bfa30fa10056b0ee07a58b7d09bc87617fbb7cd2 (commit)
       via  12520e0f723916bb803946d6ba6f5f929bba0120 (commit)
       via  f9d90d054510548490d0a7555b186201ae9f1a45 (commit)
       via  f57933cac8dfd8d4c64d970b1991c263154b0a82 (commit)
       via  bed34f1bd81edd04d55a46cf43658b8339aac1de (commit)
       via  861e2da31d76947b8358930c9f43eed0aa15b642 (commit)
       via  bb1985c5408ac6c130c3f94197fcd987b7e7edc2 (commit)
       via  8c020fc541e6a00736c9897f791e1a3ea76ef0d6 (commit)
       via  e3da80d92561e8a5fdc65fb0a5db18e09cf9ef1e (commit)
       via  fe916d26c37622ee0c6198385dcf86ea7fb545dc (commit)
       via  e7c62e41461995c3ad73be65cb7a9f63e77081b9 (commit)
       via  fcb3a56802c4bf8757424375baf3c4fe053aafbd (commit)
       via  9a296bc30b860e3360fbc4b7adaa1113461a1c89 (commit)
       via  e99e08cc167535daf324d81d510ca8f818ce924c (commit)
       via  ca4bddc08179c8c9c1585f1949bbc840869c1d9f (commit)
       via  064724040af65c7edc985877b637560620136565 (commit)
       via  be096139cf7380f89d8aaad3ea283559b27b2614 (commit)
       via  cd351ef2c427284eea0ab494eba5d4f24bc0e050 (commit)
       via  fbd83948675f4b1cb487d59390cfe1689f801fc0 (commit)
       via  c341f4679ad00cb65c7660b474ddabd13d0ef498 (commit)
       via  6960516b6b053816313d2ff5ee4e9375a84829cb (commit)
       via  e0fd2d0446101847dd40cfe4cc451667d04ddcd9 (commit)
       via  ad70a236f4368c21c08bcd4ea4d28425176c4e17 (commit)
       via  e3ca17e13b8d2aecc6d97ac800d65c6c35378a98 (commit)
       via  0bbdbd95c9515a4714ef1d57a17c7271bc4d1774 (commit)
       via  9440d5776bf48778d452e2d3a48d4e93d7b6f7a7 (commit)
      from  61cdf5d4af56e5e5f7d30448828cc7a35a8ae4a7 (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=738e3e9d9af191e7f118e182bb3ba3690430e2af
commit 738e3e9d9af191e7f118e182bb3ba3690430e2af
Merge: 61cdf5d 6ad1537
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 07:45:30 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Aug 27 07:45:30 2016 -0400

    Merge topic 'cleanup-Convert' into next
    
    6ad15378 Convert: Make variables a bit more clear
    a11a408a Convert: Remove UNCHANGED enum value
    bfa30fa1 Convert: Remove 'FULL' conversion
    12520e0f Convert: Replace Convert(FULL) with equivalent
    f9d90d05 Ninja: Replace ternary with if()
    f57933ca Convert: Replace trivial conversion with new method
    bed34f1b Convert: Replace UNCHANGED conversions with new API call
    861e2da3 Convert: Extract ConvertToRelativePath from Convert()
    bb1985c5 Convert: Replace FULL conversions with equivalent
    8c020fc5 VS: Replace FULL/UNCHANGED conversion with equivalent
    e3da80d9 Convert: Remove NONE conversion
    fe916d26 Convert: Replace uses of Convert(NONE)
    e7c62e41 VS: Replace variable with an if()
    fcb3a568 Makefiles: Replace ternaries with if()s
    9a296bc3 Makefiles: Inline MakeLauncher into only caller
    e99e08cc Makefiles: Simplify MakeLauncher return value
    ...


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ad153786f119e994662c2ec05059cdf46d9dbad
commit 6ad153786f119e994662c2ec05059cdf46d9dbad
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:58 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:58 2016 +0200

    Convert: Make variables a bit more clear

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index f056a1b..630da42 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -49,26 +49,26 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
 std::string cmOutputConverter::ConvertToRelativePath(
   const std::string& source, RelativeRoot relative) const
 {
-  std::string result = source;
+  std::string result;
 
   switch (relative) {
     case HOME:
       result = this->ConvertToRelativePath(
-        this->GetState()->GetSourceDirectoryComponents(), result);
+        this->GetState()->GetSourceDirectoryComponents(), source);
       break;
     case START:
       result = this->ConvertToRelativePath(
         this->StateSnapshot.GetDirectory().GetCurrentSourceComponents(),
-        result);
+        source);
       break;
     case HOME_OUTPUT:
       result = this->ConvertToRelativePath(
-        this->GetState()->GetBinaryDirectoryComponents(), result);
+        this->GetState()->GetBinaryDirectoryComponents(), source);
       break;
     case START_OUTPUT:
       result = this->ConvertToRelativePath(
         this->StateSnapshot.GetDirectory().GetCurrentBinaryComponents(),
-        result);
+        source);
       break;
   }
   return result;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a11a408a6edcb956fe9ba7a141cfbfd8e94078d6
commit a11a408a6edcb956fe9ba7a141cfbfd8e94078d6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:57 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:57 2016 +0200

    Convert: Remove UNCHANGED enum value
    
    It is no longer used.

diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index d3f9d64..b433c18 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -57,9 +57,9 @@ protected:
   // The windows module definition source file (.def), if any.
   cmSourceFile const* ModuleDefinitionFile;
 
-  std::string Convert(
-    std::string const& source, cmOutputConverter::RelativeRoot relative,
-    cmOutputConverter::OutputFormat output = cmOutputConverter::UNCHANGED);
+  std::string Convert(std::string const& source,
+                      cmOutputConverter::RelativeRoot relative,
+                      cmOutputConverter::OutputFormat output);
 
   void AppendFortranFormatFlags(std::string& flags,
                                 cmSourceFile const& source);
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index c2403db..9af9659 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -45,7 +45,6 @@ public:
   };
   enum OutputFormat
   {
-    UNCHANGED,
     MAKERULE,
     SHELL,
     WATCOMQUOTE,
@@ -54,7 +53,7 @@ public:
   std::string ConvertToOutputFormat(const std::string& source,
                                     OutputFormat output) const;
   std::string Convert(const std::string& remote, RelativeRoot local,
-                      OutputFormat output = UNCHANGED) const;
+                      OutputFormat output) const;
   std::string ConvertToRelativePath(const std::string& remote,
                                     RelativeRoot local) const;
   std::string ConvertDirectorySeparatorsForShell(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfa30fa10056b0ee07a58b7d09bc87617fbb7cd2
commit bfa30fa10056b0ee07a58b7d09bc87617fbb7cd2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:57 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:57 2016 +0200

    Convert: Remove 'FULL' conversion
    
    It is no longer used.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 176c9a0..f056a1b 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -70,9 +70,6 @@ std::string cmOutputConverter::ConvertToRelativePath(
         this->StateSnapshot.GetDirectory().GetCurrentBinaryComponents(),
         result);
       break;
-    case FULL:
-      result = cmSystemTools::CollapseFullPath(result);
-      break;
   }
   return result;
 }
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 71bb086..c2403db 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -38,7 +38,6 @@ public:
    */
   enum RelativeRoot
   {
-    FULL,
     HOME,
     START,
     HOME_OUTPUT,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12520e0f723916bb803946d6ba6f5f929bba0120
commit 12520e0f723916bb803946d6ba6f5f929bba0120
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:57 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:57 2016 +0200

    Convert: Replace Convert(FULL) with equivalent
    
    This is more explicit than funnelling everything through the Convert
    method.

diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index bbc794d..77fbbe9 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -723,8 +723,9 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
         std::ostringstream progCmd;
         progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
         // # in target
-        progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL,
-                               cmOutputConverter::SHELL);
+        progCmd << lg->ConvertToOutputFormat(
+          cmSystemTools::CollapseFullPath(progress.Dir),
+          cmOutputConverter::SHELL);
         //
         std::set<cmGeneratorTarget const*> emitted;
         progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted);
@@ -736,8 +737,9 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
       {
         std::ostringstream progCmd;
         progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
-        progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL,
-                               cmOutputConverter::SHELL);
+        progCmd << lg->ConvertToOutputFormat(
+          cmSystemTools::CollapseFullPath(progress.Dir),
+          cmOutputConverter::SHELL);
         progCmd << " 0";
         commands.push_back(progCmd.str());
       }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2fa3f86..de9e1e5 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -688,7 +688,9 @@ std::string cmLocalGenerator::ExpandRuleVariable(
     }
   }
   if (variable == "CMAKE_COMMAND") {
-    return this->Convert(cmSystemTools::GetCMakeCommand(), FULL, SHELL);
+    return this->ConvertToOutputFormat(
+      cmSystemTools::CollapseFullPath(cmSystemTools::GetCMakeCommand()),
+      SHELL);
   }
   std::vector<std::string> enabledLanguages =
     this->GetState()->GetEnabledLanguages();
@@ -1183,7 +1185,8 @@ void cmLocalGenerator::GetTargetFlags(
           if (sf->GetExtension() == "def") {
             linkFlags +=
               this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
-            linkFlags += this->Convert(sf->GetFullPath(), FULL, SHELL);
+            linkFlags += this->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL);
             linkFlags += " ";
           }
         }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index bbec634..d07bfaa 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -133,7 +133,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
   bool forceFullPaths)
 {
   if (forceFullPaths) {
-    return this->Convert(path, cmOutputConverter::FULL, format);
+    return this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(path),
+                                       format);
   }
   return this->Convert(path, cmOutputConverter::HOME_OUTPUT, format);
 }
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index efccb4a..81251f9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -640,9 +640,9 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
   std::string cmakeShellCommand =
     this->MaybeConvertWacomShellCommand(cmSystemTools::GetCMakeCommand());
   if (cmakeShellCommand.empty()) {
-    cmakeShellCommand =
-      this->Convert(cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL,
-                    cmOutputConverter::SHELL);
+    cmakeShellCommand = this->ConvertToOutputFormat(
+      cmSystemTools::CollapseFullPath(cmSystemTools::GetCMakeCommand()),
+      cmOutputConverter::SHELL);
   }
 
   /* clang-format off */
@@ -665,16 +665,14 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
   makefileStream
     << "# The top-level source directory on which CMake was run.\n"
     << "CMAKE_SOURCE_DIR = "
-    << this->Convert(this->GetSourceDirectory(),
-                     cmOutputConverter::FULL,
+    << this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(this->GetSourceDirectory()),
                      cmOutputConverter::SHELL)
     << "\n"
     << "\n";
   makefileStream
     << "# The top-level build directory on which CMake was run.\n"
     << "CMAKE_BINARY_DIR = "
-    << this->Convert(this->GetBinaryDirectory(),
-                     cmOutputConverter::FULL,
+    << this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(this->GetBinaryDirectory()),
                      cmOutputConverter::SHELL)
     << "\n"
     << "\n";
@@ -1153,8 +1151,9 @@ void cmLocalUnixMakefileGenerator3::AppendEcho(
           cmd += color_name;
           if (progress) {
             cmd += "--progress-dir=";
-            cmd += this->Convert(progress->Dir, cmOutputConverter::FULL,
-                                 cmOutputConverter::SHELL);
+            cmd += this->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(progress->Dir),
+              cmOutputConverter::SHELL);
             cmd += " ";
             cmd += "--progress-num=";
             cmd += progress->Arg;
@@ -1602,15 +1601,16 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   {
     std::ostringstream progCmd;
     progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
-    progCmd << this->Convert(progressDir, cmOutputConverter::FULL,
-                             cmOutputConverter::SHELL);
+    progCmd << this->ConvertToOutputFormat(
+      cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL);
 
     std::string progressFile = cmake::GetCMakeFilesDirectory();
     progressFile += "/progress.marks";
     std::string progressFileNameFull = this->ConvertToFullPath(progressFile);
     progCmd << " "
-            << this->Convert(progressFileNameFull, cmOutputConverter::FULL,
-                             cmOutputConverter::SHELL);
+            << this->ConvertToOutputFormat(
+                 cmSystemTools::CollapseFullPath(progressFileNameFull),
+                 cmOutputConverter::SHELL);
     commands.push_back(progCmd.str());
   }
   std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash();
@@ -1622,8 +1622,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   {
     std::ostringstream progCmd;
     progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
-    progCmd << this->Convert(progressDir, cmOutputConverter::FULL,
-                             cmOutputConverter::SHELL);
+    progCmd << this->ConvertToOutputFormat(
+      cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL);
     progCmd << " 0";
     commands.push_back(progCmd.str());
   }
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1beaa87..70fe819 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -269,8 +269,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   args += this->GetBinaryDirectory();
   commandLine.push_back(args);
   commandLine.push_back("--check-stamp-file");
-  std::string stampFilename = this->Convert(
-    stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::SHELL);
+  std::string stampFilename = this->ConvertToOutputFormat(
+    cmSystemTools::CollapseFullPath(stampName), cmOutputConverter::SHELL);
   commandLine.push_back(stampFilename.c_str());
 
   std::vector<std::string> const& listFiles = this->Makefile->GetListFiles();
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index d1cefe3..b492962 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -155,7 +155,8 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
     script += newline;
     newline = newline_text;
     script += "cd ";
-    script += this->Convert(workingDirectory, FULL, SHELL);
+    script += this->ConvertToOutputFormat(
+      cmSystemTools::CollapseFullPath(workingDirectory), SHELL);
     script += check_error;
 
     // Change the working drive.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index b34cd6e..165f96c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1000,9 +1000,10 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // paths.  Make sure PWD is set to the original name of the home
   // output directory to help cmSystemTools to create the same
   // translation table for the dependency scanning process.
-  depCmd << "cd " << (this->LocalGenerator->Convert(
-                       this->LocalGenerator->GetBinaryDirectory(),
-                       cmOutputConverter::FULL, cmOutputConverter::SHELL))
+  depCmd << "cd " << (this->LocalGenerator->ConvertToOutputFormat(
+                       cmSystemTools::CollapseFullPath(
+                         this->LocalGenerator->GetBinaryDirectory()),
+                       cmOutputConverter::SHELL))
          << " && ";
 #endif
   // Generate a call this signature:
@@ -1016,20 +1017,29 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
   // the state of our local generator sufficiently for its needs.
   depCmd << "$(CMAKE_COMMAND) -E cmake_depends \""
          << this->GlobalGenerator->GetName() << "\" "
-         << this->Convert(this->LocalGenerator->GetSourceDirectory(),
-                          cmOutputConverter::FULL, cmOutputConverter::SHELL)
+         << this->LocalGenerator->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(
+                this->LocalGenerator->GetSourceDirectory()),
+              cmOutputConverter::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(),
-                          cmOutputConverter::FULL, cmOutputConverter::SHELL)
+         << this->LocalGenerator->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(
+                this->LocalGenerator->GetCurrentSourceDirectory()),
+              cmOutputConverter::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetBinaryDirectory(),
-                          cmOutputConverter::FULL, cmOutputConverter::SHELL)
+         << this->LocalGenerator->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(
+                this->LocalGenerator->GetBinaryDirectory()),
+              cmOutputConverter::SHELL)
          << " "
-         << this->Convert(this->LocalGenerator->GetCurrentBinaryDirectory(),
-                          cmOutputConverter::FULL, cmOutputConverter::SHELL)
+         << this->LocalGenerator->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(
+                this->LocalGenerator->GetCurrentBinaryDirectory()),
+              cmOutputConverter::SHELL)
          << " "
-         << this->Convert(this->InfoFileNameFull, cmOutputConverter::FULL,
-                          cmOutputConverter::SHELL);
+         << this->LocalGenerator->ConvertToOutputFormat(
+              cmSystemTools::CollapseFullPath(this->InfoFileNameFull),
+              cmOutputConverter::SHELL);
   if (this->LocalGenerator->GetColorMakefile()) {
     depCmd << " --color=$(COLOR)";
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9d90d054510548490d0a7555b186201ae9f1a45
commit f9d90d054510548490d0a7555b186201ae9f1a45
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:57 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:57 2016 +0200

    Ninja: Replace ternary with if()
    
    On principle of segregating the interface.

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 9e2c920..bbec634 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -132,9 +132,10 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
   std::string const& path, cmOutputConverter::OutputFormat format,
   bool forceFullPaths)
 {
-  return this->Convert(path, forceFullPaths ? cmOutputConverter::FULL
-                                            : cmOutputConverter::HOME_OUTPUT,
-                       format);
+  if (forceFullPaths) {
+    return this->Convert(path, cmOutputConverter::FULL, format);
+  }
+  return this->Convert(path, cmOutputConverter::HOME_OUTPUT, format);
 }
 
 // Private methods.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f57933cac8dfd8d4c64d970b1991c263154b0a82
commit f57933cac8dfd8d4c64d970b1991c263154b0a82
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:56 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:56 2016 +0200

    Convert: Replace trivial conversion with new method

diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 18e123e..928f7ec 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -238,8 +238,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
   // written by the original local generator for this directory
   // convert the dependencies to paths relative to the home output
   // directory.  We must do the same here.
-  std::string obj_i =
-    this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
+  std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
+    obj, cmOutputConverter::HOME_OUTPUT);
   std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
     obj_i, cmOutputConverter::MAKERULE);
   internalDepends << obj_i << std::endl;
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index c57b558..8c0acce 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -193,15 +193,15 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
       stamp += ".mod.stamp";
       fcStream << "\n";
       fcStream << "  \""
-               << this->LocalGenerator->Convert(
+               << this->LocalGenerator->ConvertToRelativePath(
                     mod_lower, cmOutputConverter::START_OUTPUT)
                << "\"\n";
       fcStream << "  \""
-               << this->LocalGenerator->Convert(
+               << this->LocalGenerator->ConvertToRelativePath(
                     mod_upper, cmOutputConverter::START_OUTPUT)
                << "\"\n";
       fcStream << "  \""
-               << this->LocalGenerator->Convert(
+               << this->LocalGenerator->ConvertToRelativePath(
                     stamp, cmOutputConverter::START_OUTPUT)
                << "\"\n";
     }
@@ -317,8 +317,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
   const char* src = info.Source.c_str();
 
   // Write the include dependencies to the output stream.
-  std::string obj_i =
-    this->LocalGenerator->Convert(obj, cmOutputConverter::HOME_OUTPUT);
+  std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
+    obj, cmOutputConverter::HOME_OUTPUT);
   std::string obj_m = this->LocalGenerator->ConvertToOutputFormat(
     obj_i, cmOutputConverter::MAKERULE);
   internalDepends << obj_i << std::endl;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index e617b08..945ee40 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -904,8 +904,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
        it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) {
     const std::vector<cmGeneratorTarget*> targets =
       (*it)->GetGeneratorTargets();
-    std::string subdir = (*it)->Convert((*it)->GetCurrentBinaryDirectory(),
-                                        cmOutputConverter::HOME_OUTPUT);
+    std::string subdir = (*it)->ConvertToRelativePath(
+      (*it)->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
     if (subdir == ".") {
       subdir = "";
     }
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 295f65b..50c5a42 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2547,8 +2547,8 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
 
   // Shorten the output name (in expected use case).
   cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
-  std::string fname =
-    converter.Convert(outputs[0], cmOutputConverter::HOME_OUTPUT);
+  std::string fname = converter.ConvertToRelativePath(
+    outputs[0], cmOutputConverter::HOME_OUTPUT);
 
   // Associate the hash with this output.
   this->RuleHashes[fname] = hash;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2b83479..939c5ad 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -747,7 +747,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
 {
   cmLocalNinjaGenerator* ng =
     static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
-  std::string convPath = ng->Convert(path, cmOutputConverter::HOME_OUTPUT);
+  std::string convPath =
+    ng->ConvertToRelativePath(path, cmOutputConverter::HOME_OUTPUT);
   convPath = this->NinjaOutputPath(convPath);
 #ifdef _WIN32
   std::replace(convPath.begin(), convPath.end(), '/', '\\');
@@ -760,7 +761,8 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaFolderRule(
 {
   cmLocalNinjaGenerator* ng =
     static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
-  std::string convPath = ng->Convert(path + "/all", cmOutputConverter::HOME);
+  std::string convPath =
+    ng->ConvertToRelativePath(path + "/all", cmOutputConverter::HOME);
   convPath = this->NinjaOutputPath(convPath);
 #ifdef _WIN32
   std::replace(convPath.begin(), convPath.end(), '/', '\\');
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index f115ecb..bbc794d 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -311,11 +311,14 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
   cmakefileStream
     << "# The top level Makefile was generated from the following files:\n"
     << "set(CMAKE_MAKEFILE_DEPENDS\n"
-    << "  \"" << lg->Convert(cache, cmOutputConverter::START_OUTPUT) << "\"\n";
+    << "  \""
+    << lg->ConvertToRelativePath(cache, cmOutputConverter::START_OUTPUT)
+    << "\"\n";
   for (std::vector<std::string>::const_iterator i = lfiles.begin();
        i != lfiles.end(); ++i) {
     cmakefileStream << "  \""
-                    << lg->Convert(*i, cmOutputConverter::START_OUTPUT)
+                    << lg->ConvertToRelativePath(
+                         *i, cmOutputConverter::START_OUTPUT)
                     << "\"\n";
   }
   cmakefileStream << "  )\n\n";
@@ -329,10 +332,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
   cmakefileStream << "# The corresponding makefile is:\n"
                   << "set(CMAKE_MAKEFILE_OUTPUTS\n"
                   << "  \""
-                  << lg->Convert(makefileName, cmOutputConverter::START_OUTPUT)
+                  << lg->ConvertToRelativePath(makefileName,
+                                               cmOutputConverter::START_OUTPUT)
                   << "\"\n"
                   << "  \""
-                  << lg->Convert(check, cmOutputConverter::START_OUTPUT)
+                  << lg->ConvertToRelativePath(check,
+                                               cmOutputConverter::START_OUTPUT)
                   << "\"\n";
   cmakefileStream << "  )\n\n";
 
@@ -345,7 +350,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
     for (std::vector<std::string>::const_iterator k = outfiles.begin();
          k != outfiles.end(); ++k) {
       cmakefileStream << "  \""
-                      << lg->Convert(*k, cmOutputConverter::HOME_OUTPUT)
+                      << lg->ConvertToRelativePath(
+                           *k, cmOutputConverter::HOME_OUTPUT)
                       << "\"\n";
     }
 
@@ -358,7 +364,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
       tmpStr += cmake::GetCMakeFilesDirectory();
       tmpStr += "/CMakeDirectoryInformation.cmake";
       cmakefileStream << "  \""
-                      << lg->Convert(tmpStr, cmOutputConverter::HOME_OUTPUT)
+                      << lg->ConvertToRelativePath(
+                           tmpStr, cmOutputConverter::HOME_OUTPUT)
                       << "\"\n";
     }
     cmakefileStream << "  )\n\n";
@@ -519,7 +526,7 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
       tname += "/fast";
     }
     cmOutputConverter conv(mf->GetStateSnapshot());
-    tname = conv.Convert(tname, cmOutputConverter::HOME_OUTPUT);
+    tname = conv.ConvertToRelativePath(tname, cmOutputConverter::HOME_OUTPUT);
     cmSystemTools::ConvertToOutputSlashes(tname);
     makeCommand.push_back(tname);
     if (this->Makefiles.empty()) {
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0a83b3a..67ac230 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -385,7 +385,8 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
       if (vcprojName) {
         cmLocalGenerator* lg = target->GetLocalGenerator();
         std::string dir = lg->GetCurrentBinaryDirectory();
-        dir = root->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT);
+        dir = root->ConvertToRelativePath(dir.c_str(),
+                                          cmOutputConverter::START_OUTPUT);
         if (dir == ".") {
           dir = ""; // msbuild cannot handle ".\" prefix
         }
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 39d9e97..3c5e333 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -402,7 +402,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
   cmOutputConverter converter(this->Bottom);
   cmListFileContext lfc = *this->Cur;
   if (!this->Bottom.GetState()->GetIsInTryCompile()) {
-    lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+    lfc.FilePath =
+      converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
   }
   out << (lfc.Line ? " at " : " in ") << lfc;
 }
@@ -427,7 +428,8 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
     }
     cmListFileContext lfc = *i;
     if (!this->Bottom.GetState()->GetIsInTryCompile()) {
-      lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+      lfc.FilePath =
+        converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
     }
     out << "  " << lfc << "\n";
   }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 20a1e21..2fa3f86 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -176,7 +176,7 @@ void cmLocalGenerator::GenerateTestFiles()
     // TODO: Use add_subdirectory instead?
     fout << "subdirs(";
     std::string outP = children[i].GetDirectory().GetCurrentBinary();
-    fout << this->Convert(outP, START_OUTPUT);
+    fout << this->ConvertToRelativePath(outP, START_OUTPUT);
     fout << ")" << std::endl;
   }
 }
@@ -2237,7 +2237,8 @@ std::string cmLocalGenerator::ConstructComment(
     for (std::vector<std::string>::const_iterator o = ccg.GetOutputs().begin();
          o != ccg.GetOutputs().end(); ++o) {
       comment += sep;
-      comment += this->Convert(*o, cmOutputConverter::START_OUTPUT);
+      comment +=
+        this->ConvertToRelativePath(*o, cmOutputConverter::START_OUTPUT);
       sep = ", ";
     }
     return comment;
@@ -2505,13 +2506,14 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
   const char* fullPath = source.GetFullPath().c_str();
 
   // Try referencing the source relative to the source tree.
-  std::string relFromSource = this->Convert(fullPath, START);
+  std::string relFromSource = this->ConvertToRelativePath(fullPath, START);
   assert(!relFromSource.empty());
   bool relSource = !cmSystemTools::FileIsFullPath(relFromSource.c_str());
   bool subSource = relSource && relFromSource[0] != '.';
 
   // Try referencing the source relative to the binary tree.
-  std::string relFromBinary = this->Convert(fullPath, START_OUTPUT);
+  std::string relFromBinary =
+    this->ConvertToRelativePath(fullPath, START_OUTPUT);
   assert(!relFromBinary.empty());
   bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary.c_str());
   bool subBinary = relBinary && relFromBinary[0] != '.';
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 8c092e7..9e2c920 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -41,7 +41,7 @@ void cmLocalNinjaGenerator::Generate()
 {
   // Compute the path to use when referencing the current output
   // directory from the top output directory.
-  this->HomeRelativeOutputPath = this->Convert(
+  this->HomeRelativeOutputPath = this->ConvertToRelativePath(
     this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
   if (this->HomeRelativeOutputPath == ".") {
     this->HomeRelativeOutputPath = "";
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a50b1b6..efccb4a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -140,7 +140,7 @@ void cmLocalUnixMakefileGenerator3::ComputeHomeRelativeOutputPath()
 {
   // Compute the path to use when referencing the current output
   // directory from the top output directory.
-  this->HomeRelativeOutputPath = this->Convert(
+  this->HomeRelativeOutputPath = this->ConvertToRelativePath(
     this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
   if (this->HomeRelativeOutputPath == ".") {
     this->HomeRelativeOutputPath = "";
@@ -966,7 +966,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
       // working directory will be the start-output directory.
       bool had_slash = cmd.find('/') != cmd.npos;
       if (workingDir.empty()) {
-        cmd = this->Convert(cmd, cmOutputConverter::START_OUTPUT);
+        cmd =
+          this->ConvertToRelativePath(cmd, cmOutputConverter::START_OUTPUT);
       }
       bool has_slash = cmd.find('/') != cmd.npos;
       if (had_slash && !has_slash) {
@@ -1850,7 +1851,8 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
     for (std::vector<std::string>::iterator i = includes.begin();
          i != includes.end(); ++i) {
       cmakefileStream << "  \""
-                      << this->Convert(*i, cmOutputConverter::HOME_OUTPUT)
+                      << this->ConvertToRelativePath(
+                           *i, cmOutputConverter::HOME_OUTPUT)
                       << "\"\n";
     }
     cmakefileStream << "  )\n";
@@ -1914,7 +1916,8 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
   // Add the target.
   if (!tgt.empty()) {
     // The make target is always relative to the top of the build tree.
-    std::string tgt2 = this->Convert(tgt, cmOutputConverter::HOME_OUTPUT);
+    std::string tgt2 =
+      this->ConvertToRelativePath(tgt, cmOutputConverter::HOME_OUTPUT);
 
     // The target may have been written with windows paths.
     cmSystemTools::ConvertToOutputSlashes(tgt2);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2d53669..b34cd6e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -312,8 +312,10 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
   output += "/";
   output += cmSystemTools::GetFilenameName(input);
   this->Generator->CleanFiles.push_back(
-    this->Generator->Convert(output, cmOutputConverter::START_OUTPUT));
-  output = this->Generator->Convert(output, cmOutputConverter::HOME_OUTPUT);
+    this->Generator->LocalGenerator->ConvertToRelativePath(
+      output, cmOutputConverter::START_OUTPUT));
+  output = this->Generator->LocalGenerator->ConvertToRelativePath(
+    output, cmOutputConverter::HOME_OUTPUT);
 
   // Create a rule to copy the content into the bundle.
   std::vector<std::string> depends;
@@ -1171,7 +1173,8 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
   for (std::vector<std::string>::const_iterator i =
          this->ExternalObjects.begin();
        i != this->ExternalObjects.end(); ++i) {
-    object = this->Convert(*i, cmOutputConverter::START_OUTPUT);
+    object = this->LocalGenerator->ConvertToRelativePath(
+      *i, cmOutputConverter::START_OUTPUT);
     *this->BuildFileStream << " " << lineContinue << "\n"
                            << this->Makefile->GetSafeDefinition(
                                 "CMAKE_OBJECT_NAME");
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ed04d2f..d5274cd 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -602,7 +602,8 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
        it != this->TLLCommands.end(); ++it) {
     if (it->first == sig) {
       cmListFileContext lfc = it->second;
-      lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+      lfc.FilePath =
+        converter.ConvertToRelativePath(lfc.FilePath, cmOutputConverter::HOME);
       s << " * " << lfc << std::endl;
     }
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bed34f1bd81edd04d55a46cf43658b8339aac1de
commit bed34f1bd81edd04d55a46cf43658b8339aac1de
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:56 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:56 2016 +0200

    Convert: Replace UNCHANGED conversions with new API call

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 242493d..a50b1b6 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1075,8 +1075,8 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
     fout << "file(REMOVE_RECURSE\n";
     for (std::vector<std::string>::const_iterator f = files.begin();
          f != files.end(); ++f) {
-      std::string fc = this->Convert(*f, cmOutputConverter::START_OUTPUT,
-                                     cmOutputConverter::UNCHANGED);
+      std::string fc =
+        this->ConvertToRelativePath(*f, cmOutputConverter::START_OUTPUT);
       fout << "  " << cmOutputConverter::EscapeForCMake(fc) << "\n";
     }
     fout << ")\n";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 497defb..1beaa87 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -788,8 +788,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
       target->GetProperty("Fortran_MODULE_DIRECTORY");
     std::string modDir;
     if (target_mod_dir) {
-      modDir = this->Convert(target_mod_dir, cmOutputConverter::START_OUTPUT,
-                             cmOutputConverter::UNCHANGED);
+      modDir = this->ConvertToRelativePath(target_mod_dir,
+                                           cmOutputConverter::START_OUTPUT);
     } else {
       modDir = ".";
     }
@@ -1300,9 +1300,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
   cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
   for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
     if (l->IsPath) {
-      std::string rel =
-        lg->Convert(l->Value.c_str(), cmOutputConverter::START_OUTPUT,
-                    cmOutputConverter::UNCHANGED);
+      std::string rel = lg->ConvertToRelativePath(
+        l->Value.c_str(), cmOutputConverter::START_OUTPUT);
       fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
     } else if (!l->Target ||
                l->Target->GetType() != cmState::INTERFACE_LIBRARY) {
@@ -1322,8 +1321,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
   const char* sep = isep ? isep : "";
   for (std::vector<std::string>::const_iterator oi = objs.begin();
        oi != objs.end(); ++oi) {
-    std::string rel = lg->Convert(oi->c_str(), cmOutputConverter::START_OUTPUT,
-                                  cmOutputConverter::UNCHANGED);
+    std::string rel =
+      lg->ConvertToRelativePath(oi->c_str(), cmOutputConverter::START_OUTPUT);
     fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
     sep = " ";
   }
@@ -1346,9 +1345,8 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
 
     // Switch to a relative path specification if it is shorter.
     if (cmSystemTools::FileIsFullPath(dir.c_str())) {
-      std::string rel =
-        this->Convert(dir.c_str(), cmOutputConverter::START_OUTPUT,
-                      cmOutputConverter::UNCHANGED);
+      std::string rel = this->ConvertToRelativePath(
+        dir.c_str(), cmOutputConverter::START_OUTPUT);
       if (rel.size() < dir.size()) {
         dir = rel;
       }
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index a14df79..66e1ca2 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -218,40 +218,34 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   // Construct a list of files associated with this executable that
   // may need to be cleaned.
   std::vector<std::string> exeCleanFiles;
-  exeCleanFiles.push_back(this->Convert(targetFullPath,
-                                        cmOutputConverter::START_OUTPUT,
-                                        cmOutputConverter::UNCHANGED));
+  exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+    targetFullPath, cmOutputConverter::START_OUTPUT));
 #ifdef _WIN32
   // There may be a manifest file for this target.  Add it to the
   // clean set just in case.
-  exeCleanFiles.push_back(this->Convert((targetFullPath + ".manifest").c_str(),
-                                        cmOutputConverter::START_OUTPUT,
-                                        cmOutputConverter::UNCHANGED));
+  exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+    (targetFullPath + ".manifest").c_str(), cmOutputConverter::START_OUTPUT));
 #endif
   if (targetNameReal != targetName) {
-    exeCleanFiles.push_back(this->Convert(targetFullPathReal,
-                                          cmOutputConverter::START_OUTPUT,
-                                          cmOutputConverter::UNCHANGED));
+    exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+      targetFullPathReal, cmOutputConverter::START_OUTPUT));
   }
   if (!targetNameImport.empty()) {
-    exeCleanFiles.push_back(this->Convert(targetFullPathImport,
-                                          cmOutputConverter::START_OUTPUT,
-                                          cmOutputConverter::UNCHANGED));
+    exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+      targetFullPathImport, cmOutputConverter::START_OUTPUT));
     std::string implib;
     if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
                                                 implib)) {
-      exeCleanFiles.push_back(this->Convert(implib,
-                                            cmOutputConverter::START_OUTPUT,
-                                            cmOutputConverter::UNCHANGED));
+      exeCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+        implib, cmOutputConverter::START_OUTPUT));
     }
   }
 
   // List the PDB for cleaning only when the whole target is
   // cleaned.  We do not want to delete the .pdb file just before
   // linking the target.
-  this->CleanFiles.push_back(this->Convert(targetFullPathPDB,
-                                           cmOutputConverter::START_OUTPUT,
-                                           cmOutputConverter::UNCHANGED));
+  this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+    targetFullPathPDB, cmOutputConverter::START_OUTPUT));
 
   // Add the pre-build and pre-link rules building but not when relinking.
   if (!relink) {
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index c8ee05f..b85243e 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -367,46 +367,40 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
 
   // Clean files associated with this library.
   std::vector<std::string> libCleanFiles;
-  libCleanFiles.push_back(this->Convert(targetFullPath,
-                                        cmOutputConverter::START_OUTPUT,
-                                        cmOutputConverter::UNCHANGED));
+  libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+    targetFullPath, cmOutputConverter::START_OUTPUT));
   if (targetNameReal != targetName) {
-    libCleanFiles.push_back(this->Convert(targetFullPathReal,
-                                          cmOutputConverter::START_OUTPUT,
-                                          cmOutputConverter::UNCHANGED));
+    libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+      targetFullPathReal, cmOutputConverter::START_OUTPUT));
   }
   if (targetNameSO != targetName && targetNameSO != targetNameReal) {
-    libCleanFiles.push_back(this->Convert(targetFullPathSO,
-                                          cmOutputConverter::START_OUTPUT,
-                                          cmOutputConverter::UNCHANGED));
+    libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+      targetFullPathSO, cmOutputConverter::START_OUTPUT));
   }
   if (!targetNameImport.empty()) {
-    libCleanFiles.push_back(this->Convert(targetFullPathImport,
-                                          cmOutputConverter::START_OUTPUT,
-                                          cmOutputConverter::UNCHANGED));
+    libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+      targetFullPathImport, cmOutputConverter::START_OUTPUT));
     std::string implib;
     if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport,
                                                 implib)) {
-      libCleanFiles.push_back(this->Convert(implib,
-                                            cmOutputConverter::START_OUTPUT,
-                                            cmOutputConverter::UNCHANGED));
+      libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+        implib, cmOutputConverter::START_OUTPUT));
     }
   }
 
   // List the PDB for cleaning only when the whole target is
   // cleaned.  We do not want to delete the .pdb file just before
   // linking the target.
-  this->CleanFiles.push_back(this->Convert(targetFullPathPDB,
-                                           cmOutputConverter::START_OUTPUT,
-                                           cmOutputConverter::UNCHANGED));
+  this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+    targetFullPathPDB, cmOutputConverter::START_OUTPUT));
 
 #ifdef _WIN32
   // There may be a manifest file for this target.  Add it to the
   // clean set just in case.
   if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) {
-    libCleanFiles.push_back(this->Convert(
-      (targetFullPath + ".manifest").c_str(), cmOutputConverter::START_OUTPUT,
-      cmOutputConverter::UNCHANGED));
+    libCleanFiles.push_back(
+      this->ConvertToRelativePath((targetFullPath + ".manifest").c_str(),
+                                  cmOutputConverter::START_OUTPUT));
   }
 #endif
 
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index dd4333d..2d53669 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -172,8 +172,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
       const std::vector<std::string>& outputs = ccg.GetOutputs();
       for (std::vector<std::string>::const_iterator o = outputs.begin();
            o != outputs.end(); ++o) {
-        this->CleanFiles.push_back(this->Convert(
-          *o, cmOutputConverter::START_OUTPUT, cmOutputConverter::UNCHANGED));
+        this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath(
+          *o, cmOutputConverter::START_OUTPUT));
       }
     }
   }
@@ -1258,9 +1258,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
     this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget);
   std::string buildTargetRuleName = dir;
   buildTargetRuleName += relink ? "/preinstall" : "/build";
-  buildTargetRuleName =
-    this->Convert(buildTargetRuleName, cmOutputConverter::HOME_OUTPUT,
-                  cmOutputConverter::UNCHANGED);
+  buildTargetRuleName = this->LocalGenerator->ConvertToRelativePath(
+    buildTargetRuleName, cmOutputConverter::HOME_OUTPUT);
 
   // Build the list of target outputs to drive.
   std::vector<std::string> depends;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 1b1d04b..216de03 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2416,9 +2416,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
   ItemVector libs = cli.GetItems();
   for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
     if (l->IsPath) {
-      std::string path = this->LocalGenerator->Convert(
-        l->Value.c_str(), cmOutputConverter::START_OUTPUT,
-        cmOutputConverter::UNCHANGED);
+      std::string path = this->LocalGenerator->ConvertToRelativePath(
+        l->Value.c_str(), cmOutputConverter::START_OUTPUT);
       this->ConvertToWindowsSlash(path);
       libVec.push_back(path);
     } else if (!l->Target ||

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=861e2da31d76947b8358930c9f43eed0aa15b642
commit 861e2da31d76947b8358930c9f43eed0aa15b642
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:56 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:56 2016 +0200

    Convert: Extract ConvertToRelativePath from Convert()
    
    Convert() does some kind of relative conversion, followed by a
    conversion to 'output format'.
    
    Make it possible to do the former without the latter.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 80fa4bf..176c9a0 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -46,11 +46,9 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
   return this->ConvertToOutputFormat(remote, format);
 }
 
-std::string cmOutputConverter::Convert(const std::string& source,
-                                       RelativeRoot relative,
-                                       OutputFormat output) const
+std::string cmOutputConverter::ConvertToRelativePath(
+  const std::string& source, RelativeRoot relative) const
 {
-  // Convert the path to a relative path.
   std::string result = source;
 
   switch (relative) {
@@ -76,6 +74,15 @@ std::string cmOutputConverter::Convert(const std::string& source,
       result = cmSystemTools::CollapseFullPath(result);
       break;
   }
+  return result;
+}
+
+std::string cmOutputConverter::Convert(const std::string& source,
+                                       RelativeRoot relative,
+                                       OutputFormat output) const
+{
+  // Convert the path to a relative path.
+  std::string result = this->ConvertToRelativePath(source, relative);
   return this->ConvertToOutputFormat(result, output);
 }
 
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 0f4884e..71bb086 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -56,6 +56,8 @@ public:
                                     OutputFormat output) const;
   std::string Convert(const std::string& remote, RelativeRoot local,
                       OutputFormat output = UNCHANGED) const;
+  std::string ConvertToRelativePath(const std::string& remote,
+                                    RelativeRoot local) const;
   std::string ConvertDirectorySeparatorsForShell(
     const std::string& source) const;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb1985c5408ac6c130c3f94197fcd987b7e7edc2
commit bb1985c5408ac6c130c3f94197fcd987b7e7edc2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:55 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:55 2016 +0200

    Convert: Replace FULL conversions with equivalent

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 594357f..242493d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1066,8 +1066,7 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
     cleanfile += filename;
   }
   cleanfile += ".cmake";
-  std::string cleanfilePath =
-    this->Convert(cleanfile, cmOutputConverter::FULL);
+  std::string cleanfilePath = cmSystemTools::CollapseFullPath(cleanfile);
   cmsys::ofstream fout(cleanfilePath.c_str());
   if (!fout) {
     cmSystemTools::Error("Could not create ", cleanfilePath.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7747aa7..dd4333d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -393,9 +393,9 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
   std::string objFullPath = this->LocalGenerator->GetCurrentBinaryDirectory();
   objFullPath += "/";
   objFullPath += obj;
-  objFullPath = this->Convert(objFullPath, cmOutputConverter::FULL);
+  objFullPath = cmSystemTools::CollapseFullPath(objFullPath);
   std::string srcFullPath =
-    this->Convert(source.GetFullPath(), cmOutputConverter::FULL);
+    cmSystemTools::CollapseFullPath(source.GetFullPath());
   this->LocalGenerator->AddImplicitDepends(
     this->GeneratorTarget, lang, objFullPath.c_str(), srcFullPath.c_str());
 }
@@ -584,9 +584,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         lang_can_export_cmds && compileCommands.size() == 1) {
       std::string compileCommand = compileCommands[0];
       this->LocalGenerator->ExpandRuleVariables(compileCommand, vars);
-      std::string workingDirectory = this->LocalGenerator->Convert(
-        this->LocalGenerator->GetCurrentBinaryDirectory(),
-        cmOutputConverter::FULL);
+      std::string workingDirectory = cmSystemTools::CollapseFullPath(
+        this->LocalGenerator->GetCurrentBinaryDirectory());
       compileCommand.replace(compileCommand.find(langFlags), langFlags.size(),
                              this->GetFlags(lang));
       std::string langDefines = std::string("$(") + lang + "_DEFINES)";
@@ -1115,10 +1114,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
   for (cmCustomCommand::ImplicitDependsList::const_iterator idi =
          ccg.GetCC().GetImplicitDepends().begin();
        idi != ccg.GetCC().GetImplicitDepends().end(); ++idi) {
-    std::string objFullPath =
-      this->Convert(outputs[0], cmOutputConverter::FULL);
-    std::string srcFullPath =
-      this->Convert(idi->second, cmOutputConverter::FULL);
+    std::string objFullPath = cmSystemTools::CollapseFullPath(outputs[0]);
+    std::string srcFullPath = cmSystemTools::CollapseFullPath(idi->second);
     this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi->first,
                                              objFullPath.c_str(),
                                              srcFullPath.c_str());

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c020fc541e6a00736c9897f791e1a3ea76ef0d6
commit 8c020fc541e6a00736c9897f791e1a3ea76ef0d6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:55 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:55 2016 +0200

    VS: Replace FULL/UNCHANGED conversion with equivalent

diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index e72abe9..497defb 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -278,8 +278,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
   cmCustomCommandLines commandLines;
   commandLines.push_back(commandLine);
   const char* no_working_directory = 0;
-  std::string fullpathStampName = this->Convert(
-    stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::UNCHANGED);
+  std::string fullpathStampName =
+    cmSystemTools::CollapseFullPath(stampName.c_str());
   this->Makefile->AddCustomCommandToOutput(
     fullpathStampName.c_str(), listFiles, makefileIn.c_str(), commandLines,
     comment.c_str(), no_working_directory, true);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3da80d92561e8a5fdc65fb0a5db18e09cf9ef1e
commit e3da80d92561e8a5fdc65fb0a5db18e09cf9ef1e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:55 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:55 2016 +0200

    Convert: Remove NONE conversion
    
    It is no longer used.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 98872d6..80fa4bf 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -75,8 +75,6 @@ std::string cmOutputConverter::Convert(const std::string& source,
     case FULL:
       result = cmSystemTools::CollapseFullPath(result);
       break;
-    case NONE:
-      break;
   }
   return this->ConvertToOutputFormat(result, output);
 }
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index ff06ab6..0f4884e 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -38,7 +38,6 @@ public:
    */
   enum RelativeRoot
   {
-    NONE,
     FULL,
     HOME,
     START,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe916d26c37622ee0c6198385dcf86ea7fb545dc
commit fe916d26c37622ee0c6198385dcf86ea7fb545dc
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:55 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:55 2016 +0200

    Convert: Replace uses of Convert(NONE)
    
    These are equivalent to ConvertToOutputFormat.

diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index 5502296..1383421 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -74,8 +74,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
     for (std::vector<std::string>::const_iterator idi = includes.begin();
          idi != includes.end(); ++idi) {
       std::string flg = modpath_flag;
-      flg +=
-        this->Convert(*idi, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+      flg += this->ConvertToOutputFormat(*idi, cmOutputConverter::SHELL);
       this->AppendFlags(flags, flg);
     }
   }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d8f6bdf..20a1e21 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1393,7 +1393,7 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
         sp += lib.substr(pos);
 
         // Convert to an output path.
-        return this->Convert(sp.c_str(), NONE, format);
+        return this->ConvertToOutputFormat(sp.c_str(), format);
       }
     }
   }
@@ -1489,7 +1489,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
     for (std::vector<std::string>::const_iterator fdi = fwDirs.begin();
          fdi != fwDirs.end(); ++fdi) {
       frameworkPath += fwSearchFlag;
-      frameworkPath += this->Convert(*fdi, NONE, shellFormat);
+      frameworkPath += this->ConvertToOutputFormat(*fdi, shellFormat);
       frameworkPath += " ";
     }
   }
@@ -1535,7 +1535,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
     for (std::vector<std::string>::iterator ri = runtimeDirs.begin();
          ri != runtimeDirs.end(); ++ri) {
       rpath += cli.GetRuntimeFlag();
-      rpath += this->Convert(*ri, NONE, shellFormat);
+      rpath += this->ConvertToOutputFormat(*ri, shellFormat);
       rpath += " ";
     }
     fout << rpath;
@@ -1605,7 +1605,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
       flags += " ";
       flags += sysrootFlag;
       flags += " ";
-      flags += this->Convert(sysroot, NONE, SHELL);
+      flags += this->ConvertToOutputFormat(sysroot, SHELL);
     }
 
     if (deploymentTargetFlag && *deploymentTargetFlag && deploymentTarget &&
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 58c336d..8c092e7 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -490,8 +490,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
       output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
                              cmOutputConverter::SHELL);
     } else {
-      output = this->Convert(outputs[0], cmOutputConverter::NONE,
-                             cmOutputConverter::SHELL);
+      output =
+        this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
     }
   }
   vars.Output = output.c_str();
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 820ad19..594357f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -602,8 +602,7 @@ std::string cmLocalUnixMakefileGenerator3::MaybeConvertWacomShellCommand(
     // lines with shell redirection operators.
     std::string scmd;
     if (cmSystemTools::GetShortPath(cmd, scmd)) {
-      return this->Convert(scmd, cmOutputConverter::NONE,
-                           cmOutputConverter::SHELL);
+      return this->ConvertToOutputFormat(scmd, cmOutputConverter::SHELL);
     }
   }
   return std::string();
@@ -790,8 +789,8 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
     std::string runRule =
       "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
     runRule += " --check-build-system ";
-    runRule += this->Convert(cmakefileName, cmOutputConverter::NONE,
-                             cmOutputConverter::SHELL);
+    runRule +=
+      this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);
     runRule += " 0";
 
     std::vector<std::string> no_depends;
@@ -995,8 +994,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
                                    cmOutputConverter::SHELL);
 
           } else {
-            output = this->Convert(outputs[0], cmOutputConverter::NONE,
-                                   cmOutputConverter::SHELL);
+            output = this->ConvertToOutputFormat(outputs[0],
+                                                 cmOutputConverter::SHELL);
           }
         }
         vars.Output = output.c_str();
@@ -1680,8 +1679,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   std::string runRule =
     "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
   runRule += " --check-build-system ";
-  runRule += this->Convert(cmakefileName, cmOutputConverter::NONE,
-                           cmOutputConverter::SHELL);
+  runRule +=
+    this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);
   runRule += " 1";
   commands.push_back(runRule);
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
@@ -1894,8 +1893,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
   // Call make on the given file.
   std::string cmd;
   cmd += "$(MAKE) -f ";
-  cmd +=
-    this->Convert(makefile, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+  cmd += this->ConvertToOutputFormat(makefile, cmOutputConverter::SHELL);
   cmd += " ";
 
   cmGlobalUnixMakefileGenerator3* gg =
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index ca006b7..d1cefe3 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -205,7 +205,7 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
     if (workingDirectory.empty()) {
       script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL);
     } else {
-      script += this->Convert(cmd.c_str(), NONE, SHELL);
+      script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
     }
     ccg.AppendArguments(c, script);
 
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 74bfedc..a14df79 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -135,8 +135,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   std::string targetFullPathReal = outpath + targetNameReal;
   std::string targetFullPathPDB = pdbOutputPath + targetNamePDB;
   std::string targetFullPathImport = outpathImp + targetNameImport;
-  std::string targetOutPathPDB = this->Convert(
-    targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+  std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
+    targetFullPathPDB, cmOutputConverter::SHELL);
   // Convert to the output path to use in constructing commands.
   std::string targetOutPath = this->Convert(
     targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
@@ -357,9 +357,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     vars.Manifests = manifests.c_str();
 
     if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
-      std::string cmakeCommand =
-        this->Convert(cmSystemTools::GetCMakeCommand(), cmLocalGenerator::NONE,
-                      cmLocalGenerator::SHELL);
+      std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
+        cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
       cmakeCommand += " -E __run_iwyu --lwyu=";
       cmakeCommand += targetOutPathReal;
       real_link_commands.push_back(cmakeCommand);
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 6727bd0..c8ee05f 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -310,8 +310,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
 
   // Construct the output path version of the names for use in command
   // arguments.
-  std::string targetOutPathPDB = this->Convert(
-    targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+  std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
+    targetFullPathPDB, cmOutputConverter::SHELL);
   std::string targetOutPath = this->Convert(
     targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL);
   std::string targetOutPathSO =
@@ -572,8 +572,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
         vars.TargetInstallNameDir = "";
       } else {
         // Convert to a path for the native build tool.
-        install_name_dir = this->LocalGenerator->Convert(
-          install_name_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+        install_name_dir = this->LocalGenerator->ConvertToOutputFormat(
+          install_name_dir, cmOutputConverter::SHELL);
         vars.TargetInstallNameDir = install_name_dir.c_str();
       }
     }
@@ -640,9 +640,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
       cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
       if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") &&
           (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) {
-        std::string cmakeCommand =
-          this->Convert(cmSystemTools::GetCMakeCommand(),
-                        cmLocalGenerator::NONE, cmLocalGenerator::SHELL);
+        std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
+          cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
         cmakeCommand += " -E __run_iwyu --lwyu=";
         cmakeCommand += targetOutPathReal;
         real_link_commands.push_back(cmakeCommand);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 5bba29c..7747aa7 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -324,11 +324,11 @@ void cmMakefileTargetGenerator::MacOSXContentGeneratorType::operator()(
   this->Generator->LocalGenerator->AppendEcho(
     commands, copyEcho, cmLocalUnixMakefileGenerator3::EchoBuild);
   std::string copyCommand = "$(CMAKE_COMMAND) -E copy ";
-  copyCommand += this->Generator->Convert(input, cmOutputConverter::NONE,
-                                          cmOutputConverter::SHELL);
+  copyCommand += this->Generator->LocalGenerator->ConvertToOutputFormat(
+    input, cmOutputConverter::SHELL);
   copyCommand += " ";
-  copyCommand += this->Generator->Convert(output, cmOutputConverter::NONE,
-                                          cmOutputConverter::SHELL);
+  copyCommand += this->Generator->LocalGenerator->ConvertToOutputFormat(
+    output, cmOutputConverter::SHELL);
   commands.push_back(copyCommand);
   this->Generator->LocalGenerator->WriteMakeRule(
     *this->Generator->BuildFileStream, CM_NULLPTR, output, depends, commands,
@@ -464,8 +464,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
   }
 
   // Get the output paths for source and object files.
-  std::string sourceFile = this->Convert(
-    source.GetFullPath(), cmOutputConverter::NONE, cmOutputConverter::SHELL);
+  std::string sourceFile = this->LocalGenerator->ConvertToOutputFormat(
+    source.GetFullPath(), cmOutputConverter::SHELL);
 
   // Construct the build message.
   std::vector<std::string> no_commands;
@@ -516,8 +516,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
     targetOutPathReal =
       this->Convert(targetFullPathReal, cmOutputConverter::START_OUTPUT,
                     cmOutputConverter::SHELL);
-    targetOutPathPDB = this->Convert(
-      targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+    targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat(
+      targetFullPathPDB, cmOutputConverter::SHELL);
     targetOutPathCompilePDB =
       this->Convert(targetFullPathCompilePDB, cmOutputConverter::START_OUTPUT,
                     cmOutputConverter::SHELL);
@@ -539,7 +539,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
   vars.TargetCompilePDB = targetOutPathCompilePDB.c_str();
   vars.Source = sourceFile.c_str();
   std::string shellObj =
-    this->Convert(obj, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+    this->LocalGenerator->ConvertToOutputFormat(obj, cmOutputConverter::SHELL);
   vars.Object = shellObj.c_str();
   std::string objectDir = this->GeneratorTarget->GetSupportDirectory();
   objectDir = this->Convert(objectDir, cmOutputConverter::START_OUTPUT,
@@ -699,8 +699,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         std::vector<std::string> preprocessCommands;
         cmSystemTools::ExpandListArgument(preprocessRule, preprocessCommands);
 
-        std::string shellObjI = this->Convert(objI, cmOutputConverter::NONE,
-                                              cmOutputConverter::SHELL);
+        std::string shellObjI = this->LocalGenerator->ConvertToOutputFormat(
+          objI, cmOutputConverter::SHELL);
         vars.PreprocessedSource = shellObjI.c_str();
 
         // Expand placeholders in the commands.
@@ -746,8 +746,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         std::vector<std::string> assemblyCommands;
         cmSystemTools::ExpandListArgument(assemblyRule, assemblyCommands);
 
-        std::string shellObjS = this->Convert(objS, cmOutputConverter::NONE,
-                                              cmOutputConverter::SHELL);
+        std::string shellObjS = this->LocalGenerator->ConvertToOutputFormat(
+          objS, cmOutputConverter::SHELL);
         vars.AssemblySource = shellObjS.c_str();
 
         // Expand placeholders in the commands.
@@ -1576,8 +1576,8 @@ void cmMakefileTargetGenerator::CreateLinkLibs(
 
     // Reference the response file.
     linkLibs = responseFlag;
-    linkLibs += this->Convert(link_rsp, cmOutputConverter::NONE,
-                              cmOutputConverter::SHELL);
+    linkLibs += this->LocalGenerator->ConvertToOutputFormat(
+      link_rsp, cmOutputConverter::SHELL);
   }
 }
 
@@ -1625,8 +1625,8 @@ void cmMakefileTargetGenerator::CreateObjectLists(
 
       // Reference the response file.
       buildObjs += responseFlag;
-      buildObjs += this->Convert(objects_rsp, cmOutputConverter::NONE,
-                                 cmOutputConverter::SHELL);
+      buildObjs += this->LocalGenerator->ConvertToOutputFormat(
+        objects_rsp, cmOutputConverter::SHELL);
     }
   } else if (useLinkScript) {
     if (!useArchiveRules) {
@@ -1683,8 +1683,8 @@ void cmMakefileTargetGenerator::GenDefFile(
     name_of_def_file += std::string("/") + this->GeneratorTarget->GetName();
     name_of_def_file += ".def";
     std::string cmd = cmSystemTools::GetCMakeCommand();
-    cmd =
-      this->Convert(cmd, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+    cmd = this->LocalGenerator->ConvertToOutputFormat(
+      cmd, cmOutputConverter::SHELL);
     cmd += " -E __create_def ";
     cmd += this->Convert(name_of_def_file, cmOutputConverter::START_OUTPUT,
                          cmOutputConverter::SHELL);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index d0db133..335b552 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -543,8 +543,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
       std::string install_dir =
         this->GetGeneratorTarget()->GetInstallNameDirForBuildTree(cfgName);
       if (!install_dir.empty()) {
-        vars["INSTALLNAME_DIR"] = localGen.Convert(
-          install_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL);
+        vars["INSTALLNAME_DIR"] = localGen.ConvertToOutputFormat(
+          install_dir, cmOutputConverter::SHELL);
       }
     }
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7c62e41461995c3ad73be65cb7a9f63e77081b9
commit e7c62e41461995c3ad73be65cb7a9f63e77081b9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:54 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:54 2016 +0200

    VS: Replace variable with an if()

diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index bdb1c2b..ca006b7 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -127,7 +127,6 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
 {
   bool useLocal = this->CustomCommandUseLocal();
   std::string workingDirectory = ccg.GetWorkingDirectory();
-  RelativeRoot relativeRoot = workingDirectory.empty() ? START_OUTPUT : NONE;
 
   // Avoid leading or trailing newlines.
   std::string newline = "";
@@ -203,7 +202,11 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
       }
     }
 
-    script += this->Convert(cmd.c_str(), relativeRoot, SHELL);
+    if (workingDirectory.empty()) {
+      script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL);
+    } else {
+      script += this->Convert(cmd.c_str(), NONE, SHELL);
+    }
     ccg.AppendArguments(c, script);
 
     // After each custom command, check for an error result.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fcb3a56802c4bf8757424375baf3c4fe053aafbd
commit fcb3a56802c4bf8757424375baf3c4fe053aafbd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:54 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:54 2016 +0200

    Makefiles: Replace ternaries with if()s

diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 46d7e18..58c336d 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -486,12 +486,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
   std::string output;
   const std::vector<std::string>& outputs = ccg.GetOutputs();
   if (!outputs.empty()) {
-    cmOutputConverter::RelativeRoot relative_root =
-      ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT
-                                        : cmOutputConverter::NONE;
-
-    output =
-      this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL);
+    if (ccg.GetWorkingDirectory().empty()) {
+      output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
+                             cmOutputConverter::SHELL);
+    } else {
+      output = this->Convert(outputs[0], cmOutputConverter::NONE,
+                             cmOutputConverter::SHELL);
+    }
   }
   vars.Output = output.c_str();
 
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index d7f6b66..820ad19 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -990,10 +990,14 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
         std::string output;
         const std::vector<std::string>& outputs = ccg.GetOutputs();
         if (!outputs.empty()) {
-          output = this->Convert(outputs[0], workingDir.empty()
-                                   ? cmOutputConverter::START_OUTPUT
-                                   : cmOutputConverter::NONE,
-                                 cmOutputConverter::SHELL);
+          if (workingDir.empty()) {
+            output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
+                                   cmOutputConverter::SHELL);
+
+          } else {
+            output = this->Convert(outputs[0], cmOutputConverter::NONE,
+                                   cmOutputConverter::SHELL);
+          }
         }
         vars.Output = output.c_str();
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a296bc30b860e3360fbc4b7adaa1113461a1c89
commit 9a296bc30b860e3360fbc4b7adaa1113461a1c89
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:54 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:54 2016 +0200

    Makefiles: Inline MakeLauncher into only caller

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 1c66eb6..d7f6b66 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -976,9 +976,33 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
         // without the current directory being in the search path.
         cmd = "./" + cmd;
       }
-      std::string launcher = this->MakeLauncher(
-        ccg, target, workingDir.empty() ? cmOutputConverter::START_OUTPUT
-                                        : cmOutputConverter::NONE);
+
+      std::string launcher;
+      // Short-circuit if there is no launcher.
+      const char* prop = "RULE_LAUNCH_CUSTOM";
+      const char* val = this->GetRuleLauncher(target, prop);
+      if (val && *val) {
+        // Expand rules in the empty string.  It may insert the launcher and
+        // perform replacements.
+        RuleVariables vars;
+        vars.RuleLauncher = prop;
+        vars.CMTarget = target;
+        std::string output;
+        const std::vector<std::string>& outputs = ccg.GetOutputs();
+        if (!outputs.empty()) {
+          output = this->Convert(outputs[0], workingDir.empty()
+                                   ? cmOutputConverter::START_OUTPUT
+                                   : cmOutputConverter::NONE,
+                                 cmOutputConverter::SHELL);
+        }
+        vars.Output = output.c_str();
+
+        this->ExpandRuleVariables(launcher, vars);
+        if (!launcher.empty()) {
+          launcher += " ";
+        }
+      }
+
       std::string shellCommand = this->MaybeConvertWacomShellCommand(cmd);
       if (shellCommand.empty()) {
         shellCommand = cmd;
@@ -1026,35 +1050,6 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
   commands.insert(commands.end(), commands1.begin(), commands1.end());
 }
 
-std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
-  cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target,
-  cmOutputConverter::RelativeRoot relative)
-{
-  std::string launcher;
-  // Short-circuit if there is no launcher.
-  const char* prop = "RULE_LAUNCH_CUSTOM";
-  const char* val = this->GetRuleLauncher(target, prop);
-  if (val && *val) {
-    // Expand rules in the empty string.  It may insert the launcher and
-    // perform replacements.
-    RuleVariables vars;
-    vars.RuleLauncher = prop;
-    vars.CMTarget = target;
-    std::string output;
-    const std::vector<std::string>& outputs = ccg.GetOutputs();
-    if (!outputs.empty()) {
-      output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL);
-    }
-    vars.Output = output.c_str();
-
-    this->ExpandRuleVariables(launcher, vars);
-    if (!launcher.empty()) {
-      launcher += " ";
-    }
-  }
-  return launcher;
-}
-
 void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
   std::vector<std::string>& commands, const std::vector<std::string>& files,
   cmGeneratorTarget* target, const char* filename)
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 9541f65..bc7566e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -251,9 +251,6 @@ protected:
 
 private:
   std::string MaybeConvertWacomShellCommand(std::string const& cmd);
-  std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
-                           cmGeneratorTarget* target,
-                           cmOutputConverter::RelativeRoot relative);
 
   void ComputeObjectFilenames(
     std::map<cmSourceFile const*, std::string>& mapping,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e99e08cc167535daf324d81d510ca8f818ce924c
commit e99e08cc167535daf324d81d510ca8f818ce924c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:54 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:54 2016 +0200

    Makefiles: Simplify MakeLauncher return value
    
    Bonus NRVO.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 5190a95..1c66eb6 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1030,6 +1030,7 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
   cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target,
   cmOutputConverter::RelativeRoot relative)
 {
+  std::string launcher;
   // Short-circuit if there is no launcher.
   const char* prop = "RULE_LAUNCH_CUSTOM";
   const char* val = this->GetRuleLauncher(target, prop);
@@ -1046,14 +1047,12 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
     }
     vars.Output = output.c_str();
 
-    std::string launcher;
     this->ExpandRuleVariables(launcher, vars);
     if (!launcher.empty()) {
       launcher += " ";
     }
-    return launcher;
   }
-  return "";
+  return launcher;
 }
 
 void cmLocalUnixMakefileGenerator3::AppendCleanCommand(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca4bddc08179c8c9c1585f1949bbc840869c1d9f
commit ca4bddc08179c8c9c1585f1949bbc840869c1d9f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:54 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:54 2016 +0200

    Makefiles: Invert logic in MakeLauncher
    
    Make it easier to inline into the caller.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index b3d601a..5190a95 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1033,28 +1033,27 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
   // Short-circuit if there is no launcher.
   const char* prop = "RULE_LAUNCH_CUSTOM";
   const char* val = this->GetRuleLauncher(target, prop);
-  if (!(val && *val)) {
-    return "";
-  }
-
-  // Expand rules in the empty string.  It may insert the launcher and
-  // perform replacements.
-  RuleVariables vars;
-  vars.RuleLauncher = prop;
-  vars.CMTarget = target;
-  std::string output;
-  const std::vector<std::string>& outputs = ccg.GetOutputs();
-  if (!outputs.empty()) {
-    output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL);
-  }
-  vars.Output = output.c_str();
+  if (val && *val) {
+    // Expand rules in the empty string.  It may insert the launcher and
+    // perform replacements.
+    RuleVariables vars;
+    vars.RuleLauncher = prop;
+    vars.CMTarget = target;
+    std::string output;
+    const std::vector<std::string>& outputs = ccg.GetOutputs();
+    if (!outputs.empty()) {
+      output = this->Convert(outputs[0], relative, cmOutputConverter::SHELL);
+    }
+    vars.Output = output.c_str();
 
-  std::string launcher;
-  this->ExpandRuleVariables(launcher, vars);
-  if (!launcher.empty()) {
-    launcher += " ";
+    std::string launcher;
+    this->ExpandRuleVariables(launcher, vars);
+    if (!launcher.empty()) {
+      launcher += " ";
+    }
+    return launcher;
   }
-  return launcher;
+  return "";
 }
 
 void cmLocalUnixMakefileGenerator3::AppendCleanCommand(

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=064724040af65c7edc985877b637560620136565
commit 064724040af65c7edc985877b637560620136565
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:53 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:53 2016 +0200

    Makefiles: Remove uselss uses of Convert
    
    Convert with NONE and UNCHANGED is a no-op.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index cb82d0a..b3d601a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -835,8 +835,7 @@ std::string cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory(
 {
   std::string dir = this->HomeRelativeOutputPath;
   dir += this->GetTargetDirectory(target);
-  return this->Convert(dir, cmOutputConverter::NONE,
-                       cmOutputConverter::UNCHANGED);
+  return dir;
 }
 
 void cmLocalUnixMakefileGenerator3::AppendFlags(std::string& flags,
@@ -982,7 +981,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
                                         : cmOutputConverter::NONE);
       std::string shellCommand = this->MaybeConvertWacomShellCommand(cmd);
       if (shellCommand.empty()) {
-        shellCommand = this->Convert(cmd, cmOutputConverter::NONE);
+        shellCommand = cmd;
       }
       cmd = launcher + shellCommand;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be096139cf7380f89d8aaad3ea283559b27b2614
commit be096139cf7380f89d8aaad3ea283559b27b2614
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:53 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:53 2016 +0200

    Makefiles: Replace method with Wacom specific API
    
    The existing method uses RelativeRoot NONE and FULL values.  In
    principle, those should be segregated interfaces.  Mixing
    NONE and FULL into the RelativeRoot enum is a case of
    
     http://thedailywtf.com/articles/What_Is_Truth_0x3f_

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f2ef5c8..cb82d0a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -592,8 +592,8 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
   }
 }
 
-std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand(
-  std::string const& cmd, cmOutputConverter::RelativeRoot root)
+std::string cmLocalUnixMakefileGenerator3::MaybeConvertWacomShellCommand(
+  std::string const& cmd)
 {
   if (this->IsWatcomWMake() && cmSystemTools::FileIsFullPath(cmd.c_str()) &&
       cmd.find_first_of("( )") != cmd.npos) {
@@ -606,7 +606,7 @@ std::string cmLocalUnixMakefileGenerator3::ConvertShellCommand(
                            cmOutputConverter::SHELL);
     }
   }
-  return this->Convert(cmd, root, cmOutputConverter::SHELL);
+  return std::string();
 }
 
 void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
@@ -638,8 +638,13 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
 #endif
   }
 
-  std::string cmakeShellCommand = this->ConvertShellCommand(
-    cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL);
+  std::string cmakeShellCommand =
+    this->MaybeConvertWacomShellCommand(cmSystemTools::GetCMakeCommand());
+  if (cmakeShellCommand.empty()) {
+    cmakeShellCommand =
+      this->Convert(cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL,
+                    cmOutputConverter::SHELL);
+  }
 
   /* clang-format off */
   makefileStream
@@ -975,7 +980,11 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
       std::string launcher = this->MakeLauncher(
         ccg, target, workingDir.empty() ? cmOutputConverter::START_OUTPUT
                                         : cmOutputConverter::NONE);
-      cmd = launcher + this->ConvertShellCommand(cmd, cmOutputConverter::NONE);
+      std::string shellCommand = this->MaybeConvertWacomShellCommand(cmd);
+      if (shellCommand.empty()) {
+        shellCommand = this->Convert(cmd, cmOutputConverter::NONE);
+      }
+      cmd = launcher + shellCommand;
 
       ccg.AppendArguments(c, cmd);
       if (content) {
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 243cc3d..9541f65 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -250,8 +250,7 @@ protected:
   void CheckMultipleOutputs(bool verbose);
 
 private:
-  std::string ConvertShellCommand(std::string const& cmd,
-                                  cmOutputConverter::RelativeRoot root);
+  std::string MaybeConvertWacomShellCommand(std::string const& cmd);
   std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
                            cmGeneratorTarget* target,
                            cmOutputConverter::RelativeRoot relative);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd351ef2c427284eea0ab494eba5d4f24bc0e050
commit cd351ef2c427284eea0ab494eba5d4f24bc0e050
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:53 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:53 2016 +0200

    Makefiles: Deduplicate variable

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 824d4b8..f2ef5c8 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -638,19 +638,20 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables(
 #endif
   }
 
+  std::string cmakeShellCommand = this->ConvertShellCommand(
+    cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL);
+
   /* clang-format off */
   makefileStream
     << "# The CMake executable.\n"
     << "CMAKE_COMMAND = "
-    << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(),
-                                 cmOutputConverter::FULL)
+    << cmakeShellCommand
     << "\n"
     << "\n";
   makefileStream
     << "# The command to remove a file.\n"
     << "RM = "
-    << this->ConvertShellCommand(cmSystemTools::GetCMakeCommand(),
-                                 cmOutputConverter::FULL)
+    << cmakeShellCommand
     << " -E remove -f\n"
     << "\n";
   makefileStream

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbd83948675f4b1cb487d59390cfe1689f801fc0
commit fbd83948675f4b1cb487d59390cfe1689f801fc0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:53 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:53 2016 +0200

    Convert: Remove obsolete GetRelativeRootPath

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 5e1babc..98872d6 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -46,23 +46,6 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
   return this->ConvertToOutputFormat(remote, format);
 }
 
-const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const
-{
-  switch (relroot) {
-    case HOME:
-      return this->GetState()->GetSourceDirectory();
-    case START:
-      return this->StateSnapshot.GetDirectory().GetCurrentSource();
-    case HOME_OUTPUT:
-      return this->GetState()->GetBinaryDirectory();
-    case START_OUTPUT:
-      return this->StateSnapshot.GetDirectory().GetCurrentBinary();
-    default:
-      break;
-  }
-  return CM_NULLPTR;
-}
-
 std::string cmOutputConverter::Convert(const std::string& source,
                                        RelativeRoot relative,
                                        OutputFormat output) const
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 9eb1846..ff06ab6 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -60,11 +60,6 @@ public:
   std::string ConvertDirectorySeparatorsForShell(
     const std::string& source) const;
 
-  /**
-    * Get path for the specified relative root.
-    */
-  const char* GetRelativeRootPath(RelativeRoot relroot) const;
-
   ///! for existing files convert to output path and short path if spaces
   std::string ConvertToOutputForExisting(const std::string& remote,
                                          OutputFormat format = SHELL) const;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c341f4679ad00cb65c7660b474ddabd13d0ef498
commit c341f4679ad00cb65c7660b474ddabd13d0ef498
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:53 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:53 2016 +0200

    Makefiles: Change AppendCustomCommand API to strings
    
    Avoid the RelativeRoot enum.  Supply the HOME_OUTPUT string at each
    callsite to make the parameter non-defaulted.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a2ac38a..824d4b8 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -900,7 +900,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomDepend(
 
 void cmLocalUnixMakefileGenerator3::AppendCustomCommands(
   std::vector<std::string>& commands, const std::vector<cmCustomCommand>& ccs,
-  cmGeneratorTarget* target, cmOutputConverter::RelativeRoot relative)
+  cmGeneratorTarget* target, std::string const& relative)
 {
   for (std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
        i != ccs.end(); ++i) {
@@ -911,8 +911,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommands(
 
 void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
   std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg,
-  cmGeneratorTarget* target, cmOutputConverter::RelativeRoot relative,
-  bool echo_comment, std::ostream* content)
+  cmGeneratorTarget* target, std::string const& relative, bool echo_comment,
+  std::ostream* content)
 {
   // Optionally create a command to display the custom command's
   // comment text.  This is used for pre-build, pre-link, and
@@ -1011,8 +1011,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
   }
 
   // Setup the proper working directory for the commands.
-  std::string relativeDir = this->GetRelativeRootPath(relative);
-  this->CreateCDCommand(commands1, dir.c_str(), relativeDir);
+  this->CreateCDCommand(commands1, dir.c_str(), relative);
 
   // push back the custom commands
   commands.insert(commands.end(), commands1.begin(), commands1.end());
@@ -1559,9 +1558,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
       this->AppendCustomDepends(depends, gt->GetPreBuildCommands());
       this->AppendCustomDepends(depends, gt->GetPostBuildCommands());
       this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt,
-                                 cmOutputConverter::START_OUTPUT);
+                                 this->GetCurrentBinaryDirectory());
       this->AppendCustomCommands(commands, gt->GetPostBuildCommands(), gt,
-                                 cmOutputConverter::START_OUTPUT);
+                                 this->GetCurrentBinaryDirectory());
       std::string targetName = gt->GetName();
       this->WriteMakeRule(ruleFileStream, targetString.c_str(), targetName,
                           depends, commands, true);
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index ed167b3..243cc3d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -228,15 +228,16 @@ protected:
                            const std::vector<cmCustomCommand>& ccs);
   void AppendCustomDepend(std::vector<std::string>& depends,
                           cmCustomCommandGenerator const& cc);
-  void AppendCustomCommands(
-    std::vector<std::string>& commands,
-    const std::vector<cmCustomCommand>& ccs, cmGeneratorTarget* target,
-    cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT);
-  void AppendCustomCommand(
-    std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg,
-    cmGeneratorTarget* target,
-    cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT,
-    bool echo_comment = false, std::ostream* content = CM_NULLPTR);
+  void AppendCustomCommands(std::vector<std::string>& commands,
+                            const std::vector<cmCustomCommand>& ccs,
+                            cmGeneratorTarget* target,
+                            std::string const& relative);
+  void AppendCustomCommand(std::vector<std::string>& commands,
+                           cmCustomCommandGenerator const& ccg,
+                           cmGeneratorTarget* target,
+                           std::string const& relative,
+                           bool echo_comment = false,
+                           std::ostream* content = CM_NULLPTR);
   void AppendCleanCommand(std::vector<std::string>& commands,
                           const std::vector<std::string>& files,
                           cmGeneratorTarget* target,
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index daf1587..74bfedc 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -257,10 +257,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   if (!relink) {
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPreBuildCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPreLinkCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
   }
 
   // Determine whether a link script will be used.
@@ -411,7 +411,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   if (!relink) {
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPostBuildCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
   }
 
   // Write the build rule.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b3cd6a2..6727bd0 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -112,7 +112,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules()
   // Add post-build rules.
   this->LocalGenerator->AppendCustomCommands(
     commands, this->GeneratorTarget->GetPostBuildCommands(),
-    this->GeneratorTarget);
+    this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
 
   // Depend on the object files.
   this->AppendObjectDepends(depends);
@@ -427,10 +427,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
   if (!relink) {
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPreBuildCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPreLinkCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
   }
 
   // Determine whether a link script will be used.
@@ -698,7 +698,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
   if (!relink) {
     this->LocalGenerator->AppendCustomCommands(
       commands, this->GeneratorTarget->GetPostBuildCommands(),
-      this->GeneratorTarget);
+      this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
   }
 
   // Compute the list of outputs.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0c637a9..5bba29c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1094,8 +1094,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
   // Now append the actual user-specified commands.
   std::ostringstream content;
   this->LocalGenerator->AppendCustomCommand(
-    commands, ccg, this->GeneratorTarget, cmOutputConverter::HOME_OUTPUT,
-    false, &content);
+    commands, ccg, this->GeneratorTarget,
+    this->LocalGenerator->GetBinaryDirectory(), false, &content);
 
   // Collect the dependencies.
   std::vector<std::string> depends;
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index dfad0c4..b709545 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -75,14 +75,14 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
 
   this->LocalGenerator->AppendCustomCommands(
     commands, this->GeneratorTarget->GetPreBuildCommands(),
-    this->GeneratorTarget);
+    this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
 
   // Depend on all custom command outputs for sources
   this->DriveCustomCommands(depends);
 
   this->LocalGenerator->AppendCustomCommands(
     commands, this->GeneratorTarget->GetPostBuildCommands(),
-    this->GeneratorTarget);
+    this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory());
 
   // Add dependencies on targets that must be built first.
   this->AppendTargetDepends(depends);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6960516b6b053816313d2ff5ee4e9375a84829cb
commit 6960516b6b053816313d2ff5ee4e9375a84829cb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:52 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:52 2016 +0200

    Makefiles: Change signature of AppendCustomCommand
    
    The RelativeRoot parameter will become non-default.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 0169b47..a2ac38a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -905,14 +905,14 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommands(
   for (std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
        i != ccs.end(); ++i) {
     cmCustomCommandGenerator ccg(*i, this->ConfigName, this);
-    this->AppendCustomCommand(commands, ccg, target, true, relative);
+    this->AppendCustomCommand(commands, ccg, target, relative, true);
   }
 }
 
 void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
   std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg,
-  cmGeneratorTarget* target, bool echo_comment,
-  cmOutputConverter::RelativeRoot relative, std::ostream* content)
+  cmGeneratorTarget* target, cmOutputConverter::RelativeRoot relative,
+  bool echo_comment, std::ostream* content)
 {
   // Optionally create a command to display the custom command's
   // comment text.  This is used for pre-build, pre-link, and
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 5e1b651..ed167b3 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -234,9 +234,9 @@ protected:
     cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT);
   void AppendCustomCommand(
     std::vector<std::string>& commands, cmCustomCommandGenerator const& ccg,
-    cmGeneratorTarget* target, bool echo_comment = false,
+    cmGeneratorTarget* target,
     cmOutputConverter::RelativeRoot relative = cmOutputConverter::HOME_OUTPUT,
-    std::ostream* content = CM_NULLPTR);
+    bool echo_comment = false, std::ostream* content = CM_NULLPTR);
   void AppendCleanCommand(std::vector<std::string>& commands,
                           const std::vector<std::string>& files,
                           cmGeneratorTarget* target,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8f14e8c..0c637a9 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1094,8 +1094,8 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
   // Now append the actual user-specified commands.
   std::ostringstream content;
   this->LocalGenerator->AppendCustomCommand(
-    commands, ccg, this->GeneratorTarget, false,
-    cmOutputConverter::HOME_OUTPUT, &content);
+    commands, ccg, this->GeneratorTarget, cmOutputConverter::HOME_OUTPUT,
+    false, &content);
 
   // Collect the dependencies.
   std::vector<std::string> depends;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0fd2d0446101847dd40cfe4cc451667d04ddcd9
commit e0fd2d0446101847dd40cfe4cc451667d04ddcd9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:52 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:52 2016 +0200

    Makefiles: Port CreateCDCommand to string-based API

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 22937e3..0169b47 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -358,7 +358,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule(
       this->GetRecursiveMakeCall(tgtMakefileName.c_str(), targetName));
   }
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                        cmOutputConverter::START_OUTPUT);
+                        this->GetCurrentBinaryDirectory());
 
   // Write the rule to the makefile.
   std::vector<std::string> no_depends;
@@ -398,7 +398,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
       commands.push_back(
         this->GetRecursiveMakeCall(makefile2.c_str(), localName));
       this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                            cmOutputConverter::START_OUTPUT);
+                            this->GetCurrentBinaryDirectory());
       this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
                           localName, depends, commands, true);
 
@@ -423,7 +423,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
       commands.push_back(
         this->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
       this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                            cmOutputConverter::START_OUTPUT);
+                            this->GetCurrentBinaryDirectory());
       this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
                           localName, depends, commands, true);
 
@@ -439,7 +439,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
         commands.push_back(
           this->GetRecursiveMakeCall(makefile2.c_str(), makeTargetName));
         this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                              cmOutputConverter::START_OUTPUT);
+                              this->GetCurrentBinaryDirectory());
         this->WriteMakeRule(ruleFileStream,
                             "Manual pre-install relink rule for target.",
                             localName, depends, commands, true);
@@ -793,7 +793,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
     commands.push_back(runRule);
     if (!this->IsRootMakefile()) {
       this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                            cmOutputConverter::START_OUTPUT);
+                            this->GetCurrentBinaryDirectory());
     }
     this->WriteMakeRule(
       makefileStream, "Special rule to run CMake to check the build system "
@@ -1011,7 +1011,8 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
   }
 
   // Setup the proper working directory for the commands.
-  this->CreateCDCommand(commands1, dir.c_str(), relative);
+  std::string relativeDir = this->GetRelativeRootPath(relative);
+  this->CreateCDCommand(commands1, dir.c_str(), relativeDir);
 
   // push back the custom commands
   commands.insert(commands.end(), commands1.begin(), commands1.end());
@@ -1613,7 +1614,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   commands.push_back(
     this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                        cmOutputConverter::START_OUTPUT);
+                        this->GetCurrentBinaryDirectory());
   {
     std::ostringstream progCmd;
     progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
@@ -1633,7 +1634,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   commands.push_back(
     this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                        cmOutputConverter::START_OUTPUT);
+                        this->GetCurrentBinaryDirectory());
   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
                       depends, commands, true);
   commands.clear();
@@ -1659,7 +1660,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   commands.push_back(
     this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                        cmOutputConverter::START_OUTPUT);
+                        this->GetCurrentBinaryDirectory());
   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
                       "preinstall", depends, commands, true);
   depends.clear();
@@ -1679,7 +1680,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
   runRule += " 1";
   commands.push_back(runRule);
   this->CreateCDCommand(commands, this->GetBinaryDirectory(),
-                        cmOutputConverter::START_OUTPUT);
+                        this->GetCurrentBinaryDirectory());
   this->WriteMakeRule(ruleFileStream, "clear depends", "depend", depends,
                       commands, true);
 }
@@ -2046,12 +2047,10 @@ void cmLocalUnixMakefileGenerator3::AddImplicitDepends(
 
 void cmLocalUnixMakefileGenerator3::CreateCDCommand(
   std::vector<std::string>& commands, const char* tgtDir,
-  cmOutputConverter::RelativeRoot relRetDir)
+  std::string const& relDir)
 {
-  const char* relDir = this->GetRelativeRootPath(relRetDir);
-
   // do we need to cd?
-  if (!strcmp(tgtDir, relDir)) {
+  if (tgtDir == relDir) {
     return;
   }
 
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 42d1d91..5e1b651 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -121,8 +121,7 @@ public:
 
   // create a command that cds to the start dir then runs the commands
   void CreateCDCommand(std::vector<std::string>& commands,
-                       const char* targetDir,
-                       cmOutputConverter::RelativeRoot returnDir);
+                       const char* targetDir, std::string const& relDir);
 
   static std::string ConvertToQuotedOutputPath(const char* p,
                                                bool useWatcomQuote);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 6fadc8f..daf1587 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -389,7 +389,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   }
   this->LocalGenerator->CreateCDCommand(
     commands1, this->Makefile->GetCurrentBinaryDirectory(),
-    cmOutputConverter::HOME_OUTPUT);
+    this->LocalGenerator->GetBinaryDirectory());
   commands.insert(commands.end(), commands1.begin(), commands1.end());
   commands1.clear();
 
@@ -402,7 +402,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     commands1.push_back(symlink);
     this->LocalGenerator->CreateCDCommand(
       commands1, this->Makefile->GetCurrentBinaryDirectory(),
-      cmOutputConverter::HOME_OUTPUT);
+      this->LocalGenerator->GetBinaryDirectory());
     commands.insert(commands.end(), commands1.begin(), commands1.end());
     commands1.clear();
   }
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 580343d..b3cd6a2 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -418,7 +418,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
                                              this->GeneratorTarget, "target");
     this->LocalGenerator->CreateCDCommand(
       commands1, this->Makefile->GetCurrentBinaryDirectory(),
-      cmOutputConverter::HOME_OUTPUT);
+      this->LocalGenerator->GetBinaryDirectory());
     commands.insert(commands.end(), commands1.begin(), commands1.end());
     commands1.clear();
   }
@@ -672,7 +672,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
   }
   this->LocalGenerator->CreateCDCommand(
     commands1, this->Makefile->GetCurrentBinaryDirectory(),
-    cmOutputConverter::HOME_OUTPUT);
+    this->LocalGenerator->GetBinaryDirectory());
   commands.insert(commands.end(), commands1.begin(), commands1.end());
   commands1.clear();
 
@@ -689,7 +689,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
     commands1.push_back(symlink);
     this->LocalGenerator->CreateCDCommand(
       commands1, this->Makefile->GetCurrentBinaryDirectory(),
-      cmOutputConverter::HOME_OUTPUT);
+      this->LocalGenerator->GetBinaryDirectory());
     commands.insert(commands.end(), commands1.begin(), commands1.end());
     commands1.clear();
   }
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 84a15e0..8f14e8c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -649,7 +649,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
     // Change the command working directory to the local build tree.
     this->LocalGenerator->CreateCDCommand(
       compileCommands, this->LocalGenerator->GetCurrentBinaryDirectory(),
-      cmOutputConverter::HOME_OUTPUT);
+      this->LocalGenerator->GetBinaryDirectory());
     commands.insert(commands.end(), compileCommands.begin(),
                     compileCommands.end());
   }
@@ -712,7 +712,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         this->LocalGenerator->CreateCDCommand(
           preprocessCommands,
           this->LocalGenerator->GetCurrentBinaryDirectory(),
-          cmOutputConverter::HOME_OUTPUT);
+          this->LocalGenerator->GetBinaryDirectory());
         commands.insert(commands.end(), preprocessCommands.begin(),
                         preprocessCommands.end());
       } else {
@@ -758,7 +758,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
 
         this->LocalGenerator->CreateCDCommand(
           assemblyCommands, this->LocalGenerator->GetCurrentBinaryDirectory(),
-          cmOutputConverter::HOME_OUTPUT);
+          this->LocalGenerator->GetBinaryDirectory());
         commands.insert(commands.end(), assemblyCommands.begin(),
                         assemblyCommands.end());
       } else {
@@ -849,7 +849,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
                                            this->GeneratorTarget);
   this->LocalGenerator->CreateCDCommand(
     commands, this->LocalGenerator->GetCurrentBinaryDirectory(),
-    cmOutputConverter::HOME_OUTPUT);
+    this->LocalGenerator->GetBinaryDirectory());
 
   // Write the rule.
   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, CM_NULLPTR,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad70a236f4368c21c08bcd4ea4d28425176c4e17
commit ad70a236f4368c21c08bcd4ea4d28425176c4e17
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:52 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:52 2016 +0200

    Convert: Remove ConvertToOutputForExisting overload
    
    It is no longer used.

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 47c2928..5e1babc 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -46,19 +46,6 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
   return this->ConvertToOutputFormat(remote, format);
 }
 
-std::string cmOutputConverter::ConvertToOutputForExisting(
-  RelativeRoot remote, OutputFormat format) const
-{
-  // The relative root must have a path (i.e. not FULL or NONE)
-  assert(remote != FULL);
-  assert(remote != NONE);
-
-  const char* remotePath = this->GetRelativeRootPath(remote);
-  assert(remotePath != CM_NULLPTR);
-
-  return this->ConvertToOutputForExisting(remotePath, format);
-}
-
 const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const
 {
   switch (relroot) {
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index d3ded25..9eb1846 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -69,11 +69,6 @@ public:
   std::string ConvertToOutputForExisting(const std::string& remote,
                                          OutputFormat format = SHELL) const;
 
-  /** For existing path identified by RelativeRoot convert to output
-      path and short path if spaces.  */
-  std::string ConvertToOutputForExisting(RelativeRoot remote,
-                                         OutputFormat format = SHELL) const;
-
   void SetLinkScriptShell(bool linkScriptShell);
 
   /**

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3ca17e13b8d2aecc6d97ac800d65c6c35378a98
commit e3ca17e13b8d2aecc6d97ac800d65c6c35378a98
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:52 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:52 2016 +0200

    Makefiles: Use string overload of ConvertToOutputForExisting
    
    The string is already determined so, no need to call the overload to
    determine it again.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4ecd0b2..22937e3 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2073,7 +2073,7 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
 
     // Change back to the starting directory.
     cmd = cd_cmd;
-    cmd += this->ConvertToOutputForExisting(relRetDir);
+    cmd += this->ConvertToOutputForExisting(relDir);
     commands.push_back(cmd);
   } else {
     // On UNIX we must construct a single shell command to change

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bbdbd95c9515a4714ef1d57a17c7271bc4d1774
commit 0bbdbd95c9515a4714ef1d57a17c7271bc4d1774
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:52 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:52 2016 +0200

    Makefiles: Rename local variable
    
    In this context, 'ret' means 'return', but I don't really know what that
    means.  It is not consistent with types and other variables used in the
    vicinity for these things.

diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7597077..4ecd0b2 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2048,10 +2048,10 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
   std::vector<std::string>& commands, const char* tgtDir,
   cmOutputConverter::RelativeRoot relRetDir)
 {
-  const char* retDir = this->GetRelativeRootPath(relRetDir);
+  const char* relDir = this->GetRelativeRootPath(relRetDir);
 
   // do we need to cd?
-  if (!strcmp(tgtDir, retDir)) {
+  if (!strcmp(tgtDir, relDir)) {
     return;
   }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9440d5776bf48778d452e2d3a48d4e93d7b6f7a7
commit 9440d5776bf48778d452e2d3a48d4e93d7b6f7a7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Aug 27 13:44:51 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Aug 27 13:44:51 2016 +0200

    Convert: Remove unused overload

diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 411184c..47c2928 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -146,27 +146,6 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
   return result;
 }
 
-std::string cmOutputConverter::Convert(RelativeRoot remote,
-                                       const std::string& local,
-                                       OutputFormat output) const
-{
-  // The relative root must have a path (i.e. not FULL or NONE)
-  assert(remote != FULL);
-  assert(remote != NONE);
-
-  const char* remotePath = this->GetRelativeRootPath(remote);
-  assert(remotePath != CM_NULLPTR);
-
-  if (local.empty()) {
-    return this->ConvertToOutputFormat(remotePath, output);
-  }
-
-  std::vector<std::string> components;
-  cmSystemTools::SplitPath(local, components);
-  std::string result = this->ConvertToRelativePath(components, remotePath);
-  return this->ConvertToOutputFormat(result, output);
-}
-
 static bool cmOutputConverterNotAbove(const char* a, const char* b)
 {
   return (cmSystemTools::ComparePath(a, b) ||
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 23f2e62..d3ded25 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -57,8 +57,6 @@ public:
                                     OutputFormat output) const;
   std::string Convert(const std::string& remote, RelativeRoot local,
                       OutputFormat output = UNCHANGED) const;
-  std::string Convert(RelativeRoot remote, const std::string& local,
-                      OutputFormat output = UNCHANGED) const;
   std::string ConvertDirectorySeparatorsForShell(
     const std::string& source) const;
 

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

Summary of changes:
 Source/cmCommonTargetGenerator.h               |    6 +-
 Source/cmDependsC.cxx                          |    4 +-
 Source/cmDependsFortran.cxx                    |   10 +-
 Source/cmExtraEclipseCDT4Generator.cxx         |    4 +-
 Source/cmGlobalGenerator.cxx                   |    4 +-
 Source/cmGlobalNinjaGenerator.cxx              |    6 +-
 Source/cmGlobalUnixMakefileGenerator3.cxx      |   31 ++--
 Source/cmGlobalVisualStudio7Generator.cxx      |    3 +-
 Source/cmListFileCache.cxx                     |    6 +-
 Source/cmLocalCommonGenerator.cxx              |    3 +-
 Source/cmLocalGenerator.cxx                    |   25 ++--
 Source/cmLocalNinjaGenerator.cxx               |   23 +--
 Source/cmLocalUnixMakefileGenerator3.cxx       |  188 ++++++++++++------------
 Source/cmLocalUnixMakefileGenerator3.h         |   28 ++--
 Source/cmLocalVisualStudio7Generator.cxx       |   26 ++--
 Source/cmLocalVisualStudioGenerator.cxx        |   10 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |   49 +++---
 Source/cmMakefileLibraryTargetGenerator.cxx    |   63 ++++----
 Source/cmMakefileTargetGenerator.cxx           |  119 ++++++++-------
 Source/cmMakefileUtilityTargetGenerator.cxx    |    4 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |    4 +-
 Source/cmOutputConverter.cxx                   |   81 ++--------
 Source/cmOutputConverter.h                     |   19 +--
 Source/cmTarget.cxx                            |    3 +-
 Source/cmVisualStudio10TargetGenerator.cxx     |    5 +-
 25 files changed, 340 insertions(+), 384 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list