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

The branch, master has been updated
       via  59f07efd592330be3018fcaa253498475055a4af (commit)
       via  5b241d0ae86569399275e1fc57b403cfb13f7c35 (commit)
       via  718daeb4e6b93527ea8fa0b87091008737b0a897 (commit)
       via  b5a5b227f9a3d88e1c493427e3983aee28c284eb (commit)
       via  bcf066435ca30a685002bcfbc6677eaaa74a6190 (commit)
       via  fd7e8f339a766b1bd4b4eca3fc96e4aac8cfb218 (commit)
       via  cf320f7cd74eeb87437f737e6e977f2231e109a1 (commit)
       via  e8b77084dfaaa211913acaec871e8f9fc0cedd88 (commit)
       via  ffdde4a9aeb7a93f1f608d92e15540a7ca43a1e6 (commit)
       via  bbb5c3efe2a17d046506b7c27008c77ea244f0bc (commit)
      from  2b7aecba1663f86148b8c2f1033cfcbd87453ad3 (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=59f07efd592330be3018fcaa253498475055a4af
commit 59f07efd592330be3018fcaa253498475055a4af
Merge: 5b241d0 fd7e8f3
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 21 12:54:34 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Apr 21 08:54:38 2017 -0400

    Merge topic 'fix-vs2017-guid-braces'
    
    fd7e8f33 VS: Fix project reference inspection in VS IDE
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !727


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b241d0ae86569399275e1fc57b403cfb13f7c35
commit 5b241d0ae86569399275e1fc57b403cfb13f7c35
Merge: 718daeb cf320f7
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 21 12:53:11 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Apr 21 08:53:16 2017 -0400

    Merge topic '16760-refactor-get-mac-content-directory'
    
    cf320f7c Replace boolean `implib` parameters with enum
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !662


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=718daeb4e6b93527ea8fa0b87091008737b0a897
commit 718daeb4e6b93527ea8fa0b87091008737b0a897
Merge: b5a5b22 bbb5c3e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 21 12:51:42 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Apr 21 08:51:49 2017 -0400

    Merge topic 'unified-commandline-length'
    
    bbb5c3ef Ninja,Makefile: Unify command line limit logic
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !705


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5a5b227f9a3d88e1c493427e3983aee28c284eb
commit b5a5b227f9a3d88e1c493427e3983aee28c284eb
Merge: bcf0664 e8b7708
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 21 12:51:03 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Apr 21 08:51:21 2017 -0400

    Merge topic 'FindwxWidgets-verify-wx-config'
    
    e8b77084 FindwxWidgets: Verify existence of libraries reported by wx-config
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !704


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcf066435ca30a685002bcfbc6677eaaa74a6190
commit bcf066435ca30a685002bcfbc6677eaaa74a6190
Merge: 2b7aecb ffdde4a
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Apr 21 12:50:17 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Apr 21 08:50:35 2017 -0400

    Merge topic '16795-xcode-system-header-search-paths'
    
    ffdde4a9 Xcode: Use SYSTEM_HEADER_SEARCH_PATHS attribute for system includes
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !726


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd7e8f339a766b1bd4b4eca3fc96e4aac8cfb218
commit fd7e8f339a766b1bd4b4eca3fc96e4aac8cfb218
Author:     Richard Walters <rwalt...@qti.qualcomm.com>
AuthorDate: Wed Apr 19 14:55:56 2017 -0700
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 20 10:30:21 2017 -0400

    VS: Fix project reference inspection in VS IDE
    
    The braces around project reference GUIDs for vcxproj projects were
    apparently optional in the past, but Visual Studio 2017 is more strict,
    displaying a warning, and not displaying project reference properties
    unless the braces are present.
    
    Fixes: #16820

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index 902fe03..cb6afe1 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3194,13 +3194,8 @@ void 
cmVisualStudio10TargetGenerator::WriteProjectReferences()
     this->ConvertToWindowsSlash(path);
     (*this->BuildFileStream) << cmVS10EscapeXML(path) << "\">\n";
     this->WriteString("<Project>", 3);
-    if (csproj == this->ProjectType) {
-      (*this->BuildFileStream) << "{";
-    }
-    (*this->BuildFileStream) << this->GlobalGenerator->GetGUID(name.c_str());
-    if (csproj == this->ProjectType) {
-      (*this->BuildFileStream) << "}";
-    }
+    (*this->BuildFileStream)
+      << "{" << this->GlobalGenerator->GetGUID(name.c_str()) << "}";
     (*this->BuildFileStream) << "</Project>\n";
     this->WriteString("<Name>", 3);
     (*this->BuildFileStream) << name << "</Name>\n";

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf320f7cd74eeb87437f737e6e977f2231e109a1
commit cf320f7cd74eeb87437f737e6e977f2231e109a1
Author:     Gregor Jasny <gja...@googlemail.com>
AuthorDate: Wed Apr 19 19:10:09 2017 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 20 10:22:33 2017 -0400

    Replace boolean `implib` parameters with enum
    
    Named enumeration values are much clearer at call sites and add more
    type safety.

diff --git a/Source/cmComputeLinkInformation.cxx 
b/Source/cmComputeLinkInformation.cxx
index 80e7e7d..b273443 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -500,7 +500,10 @@ bool cmComputeLinkInformation::Compute()
       cmGeneratorTarget const* tgt = *i;
       bool implib = (this->UseImportLibrary &&
                      (tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
-      std::string lib = tgt->GetFullPath(this->Config, implib, true);
+      cmStateEnums::ArtifactType artifact = implib
+        ? cmStateEnums::ImportLibraryArtifact
+        : cmStateEnums::RuntimeBinaryArtifact;
+      std::string lib = tgt->GetFullPath(this->Config, artifact, true);
       this->OldLinkDirItems.push_back(lib);
     }
   }
@@ -596,8 +599,11 @@ void cmComputeLinkInformation::AddItem(std::string const& 
item,
       // platform.  Add it now.
       std::string linkItem;
       linkItem = this->LoaderFlag;
+      cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+        ? cmStateEnums::ImportLibraryArtifact
+        : cmStateEnums::RuntimeBinaryArtifact;
 
-      std::string exe = tgt->GetFullPath(config, this->UseImportLibrary, true);
+      std::string exe = tgt->GetFullPath(config, artifact, true);
       linkItem += exe;
       this->Items.push_back(Item(linkItem, true, tgt));
       this->Depends.push_back(exe);
@@ -617,9 +623,12 @@ void cmComputeLinkInformation::AddItem(std::string const& 
item,
       bool implib =
         (this->UseImportLibrary &&
          (impexe || tgt->GetType() == cmStateEnums::SHARED_LIBRARY));
+      cmStateEnums::ArtifactType artifact = implib
+        ? cmStateEnums::ImportLibraryArtifact
+        : cmStateEnums::RuntimeBinaryArtifact;
 
       // Pass the full path to the target file.
-      std::string lib = tgt->GetFullPath(config, implib, true);
+      std::string lib = tgt->GetFullPath(config, artifact, true);
       if (!this->LinkDependsNoShared ||
           tgt->GetType() != cmStateEnums::SHARED_LIBRARY) {
         this->Depends.push_back(lib);
@@ -689,7 +698,10 @@ void 
cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
   // linked will be able to find it.
   std::string lib;
   if (tgt) {
-    lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
+    cmStateEnums::ArtifactType artifact = this->UseImportLibrary
+      ? cmStateEnums::ImportLibraryArtifact
+      : cmStateEnums::RuntimeBinaryArtifact;
+    lib = tgt->GetFullPath(this->Config, artifact);
     this->AddLibraryRuntimeInfo(lib, tgt);
   } else {
     lib = item;
diff --git a/Source/cmExportBuildFileGenerator.cxx 
b/Source/cmExportBuildFileGenerator.cxx
index 978a7a1..a1c424a 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -200,9 +200,11 @@ void cmExportBuildFileGenerator::SetImportLocationProperty(
       prop += suffix;
       std::string value;
       if (target->IsAppBundleOnApple()) {
-        value = target->GetFullPath(config, false);
+        value =
+          target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
       } else {
-        value = target->GetFullPath(config, false, true);
+        value = target->GetFullPath(config,
+                                    cmStateEnums::RuntimeBinaryArtifact, true);
       }
       properties[prop] = value;
     }
@@ -212,7 +214,8 @@ void cmExportBuildFileGenerator::SetImportLocationProperty(
         mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
       std::string prop = "IMPORTED_IMPLIB";
       prop += suffix;
-      std::string value = target->GetFullPath(config, true);
+      std::string value =
+        target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact);
       target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}");
       properties[prop] = value;
     }
diff --git a/Source/cmGeneratorExpressionNode.cxx 
b/Source/cmGeneratorExpressionNode.cxx
index 77a4962..e065a74 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1607,7 +1607,10 @@ struct 
TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
                     "executables with ENABLE_EXPORTS.");
       return std::string();
     }
-    return target->GetFullPath(context->Config, target->HasImportLibrary());
+    cmStateEnums::ArtifactType artifact = target->HasImportLibrary()
+      ? cmStateEnums::ImportLibraryArtifact
+      : cmStateEnums::RuntimeBinaryArtifact;
+    return target->GetFullPath(context->Config, artifact);
   }
 };
 
@@ -1668,7 +1671,8 @@ struct 
TargetFilesystemArtifactResultCreator<ArtifactNameTag>
                             cmGeneratorExpressionContext* context,
                             const GeneratorExpressionContent* /*unused*/)
   {
-    return target->GetFullPath(context->Config, false, true);
+    return target->GetFullPath(context->Config,
+                               cmStateEnums::RuntimeBinaryArtifact, true);
   }
 };
 
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2799505..1d6e7fe 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -216,52 +216,60 @@ const char* cmGeneratorTarget::GetProperty(const 
std::string& prop) const
   return this->Target->GetProperty(prop);
 }
 
-const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
+const char* cmGeneratorTarget::GetOutputTargetType(
+  cmStateEnums::ArtifactType artifact) const
 {
   switch (this->GetType()) {
     case cmStateEnums::SHARED_LIBRARY:
       if (this->IsDLLPlatform()) {
-        if (implib) {
-          // A DLL import library is treated as an archive target.
-          return "ARCHIVE";
+        switch (artifact) {
+          case cmStateEnums::RuntimeBinaryArtifact:
+            // A DLL shared library is treated as a runtime target.
+            return "RUNTIME";
+          case cmStateEnums::ImportLibraryArtifact:
+            // A DLL import library is treated as an archive target.
+            return "ARCHIVE";
         }
-        // A DLL shared library is treated as a runtime target.
-        return "RUNTIME";
       } else {
         // For non-DLL platforms shared libraries are treated as
         // library targets.
         return "LIBRARY";
       }
+      break;
     case cmStateEnums::STATIC_LIBRARY:
       // Static libraries are always treated as archive targets.
       return "ARCHIVE";
     case cmStateEnums::MODULE_LIBRARY:
-      if (implib) {
-        // Module libraries are always treated as library targets.
-        return "ARCHIVE";
-      } else {
-        // Module import libraries are treated as archive targets.
-        return "LIBRARY";
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          // Module import libraries are treated as archive targets.
+          return "LIBRARY";
+        case cmStateEnums::ImportLibraryArtifact:
+          // Module libraries are always treated as library targets.
+          return "ARCHIVE";
       }
+      break;
     case cmStateEnums::EXECUTABLE:
-      if (implib) {
-        // Executable import libraries are treated as archive targets.
-        return "ARCHIVE";
-      } else {
-        // Executables are always treated as runtime targets.
-        return "RUNTIME";
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          // Executables are always treated as runtime targets.
+          return "RUNTIME";
+        case cmStateEnums::ImportLibraryArtifact:
+          // Executable import libraries are treated as archive targets.
+          return "ARCHIVE";
       }
+      break;
     default:
       break;
   }
   return "";
 }
 
-std::string cmGeneratorTarget::GetOutputName(const std::string& config,
-                                             bool implib) const
+std::string cmGeneratorTarget::GetOutputName(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   // Lookup/compute/cache the output name for this configuration.
-  OutputNameKey key(config, implib);
+  OutputNameKey key(config, artifact);
   cmGeneratorTarget::OutputNameMapType::iterator i =
     this->OutputNameMap.find(key);
   if (i == this->OutputNameMap.end()) {
@@ -271,7 +279,7 @@ std::string cmGeneratorTarget::GetOutputName(const 
std::string& config,
 
     // Compute output name.
     std::vector<std::string> props;
-    std::string type = this->GetOutputTargetType(implib);
+    std::string type = this->GetOutputTargetType(artifact);
     std::string configUpper = cmSystemTools::UpperCase(config);
     if (!type.empty() && !configUpper.empty()) {
       // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
@@ -641,9 +649,10 @@ const char* cmGeneratorTarget::GetLocation(const 
std::string& config) const
 {
   static std::string location;
   if (this->IsImported()) {
-    location = this->Target->ImportedGetFullPath(config, false);
+    location = this->Target->ImportedGetFullPath(
+      config, cmStateEnums::RuntimeBinaryArtifact);
   } else {
-    location = this->GetFullPath(config, false);
+    location = this->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
   }
   return location.c_str();
 }
@@ -680,7 +689,8 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
 {
   static std::string location;
   if (this->IsImported()) {
-    location = this->Target->ImportedGetFullPath("", false);
+    location = this->Target->ImportedGetFullPath(
+      "", cmStateEnums::RuntimeBinaryArtifact);
     return location.c_str();
   }
 
@@ -700,7 +710,7 @@ const char* cmGeneratorTarget::GetLocationForBuild() const
     }
   }
   location += "/";
-  location += this->GetFullName("", false);
+  location += this->GetFullName("", cmStateEnums::RuntimeBinaryArtifact);
   return location.c_str();
 }
 
@@ -1145,7 +1155,8 @@ std::string cmGeneratorTarget::GetCompilePDBName(
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+                            prefix, base, suffix);
 
   // Check for a per-configuration output directory target property.
   std::string configUpper = cmSystemTools::UpperCase(config);
@@ -1506,7 +1517,8 @@ static bool shouldAddContentLevel(
 std::string cmGeneratorTarget::GetAppBundleDirectory(
   const std::string& config, BundleDirectoryLevel level) const
 {
-  std::string fpath = this->GetFullName(config, false);
+  std::string fpath =
+    this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact);
   fpath += ".";
   const char* ext = this->GetProperty("BUNDLE_EXTENSION");
   if (!ext) {
@@ -1532,7 +1544,7 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(
   const std::string& config, BundleDirectoryLevel level) const
 {
   std::string fpath;
-  fpath += this->GetOutputName(config, false);
+  fpath += this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
   fpath += ".";
   const char* ext = this->GetProperty("BUNDLE_EXTENSION");
   if (!ext) {
@@ -1556,7 +1568,7 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(
   const std::string& config, BundleDirectoryLevel level) const
 {
   std::string fpath;
-  fpath += this->GetOutputName(config, false);
+  fpath += this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
   fpath += ".";
   const char* ext = this->GetProperty("BUNDLE_EXTENSION");
   if (!ext) {
@@ -1570,13 +1582,13 @@ std::string cmGeneratorTarget::GetFrameworkDirectory(
   return fpath;
 }
 
-std::string cmGeneratorTarget::GetFullName(const std::string& config,
-                                           bool implib) const
+std::string cmGeneratorTarget::GetFullName(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   if (this->IsImported()) {
-    return this->GetFullNameImported(config, implib);
+    return this->GetFullNameImported(config, artifact);
   }
-  return this->GetFullNameInternal(config, implib);
+  return this->GetFullNameInternal(config, artifact);
 }
 
 std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
@@ -1869,13 +1881,11 @@ void cmGeneratorTarget::ComputeLinkClosure(const 
std::string& config,
   }
 }
 
-void cmGeneratorTarget::GetFullNameComponents(std::string& prefix,
-                                              std::string& base,
-                                              std::string& suffix,
-                                              const std::string& config,
-                                              bool implib) const
+void cmGeneratorTarget::GetFullNameComponents(
+  std::string& prefix, std::string& base, std::string& suffix,
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
-  this->GetFullNameInternal(config, implib, prefix, base, suffix);
+  this->GetFullNameInternal(config, artifact, prefix, base, suffix);
 }
 
 std::string cmGeneratorTarget::BuildBundleDirectory(
@@ -1896,10 +1906,10 @@ std::string cmGeneratorTarget::BuildBundleDirectory(
 }
 
 std::string cmGeneratorTarget::GetMacContentDirectory(
-  const std::string& config, bool implib) const
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   // Start with the output directory for the target.
-  std::string fpath = this->GetDirectory(config, implib);
+  std::string fpath = this->GetDirectory(config, artifact);
   fpath += "/";
   BundleDirectoryLevel level = ContentLevel;
   if (this->IsFrameworkOnApple()) {
@@ -2860,7 +2870,8 @@ void cmGeneratorTarget::ComputeTargetManifest(const 
std::string& config) const
   }
 
   // Get the directory.
-  std::string dir = this->GetDirectory(config, false);
+  std::string dir =
+    this->GetDirectory(config, cmStateEnums::RuntimeBinaryArtifact);
 
   // Add each name.
   std::string f;
@@ -2889,7 +2900,7 @@ void cmGeneratorTarget::ComputeTargetManifest(const 
std::string& config) const
     gg->AddToManifest(f);
   }
   if (!impName.empty()) {
-    f = this->GetDirectory(config, true);
+    f = this->GetDirectory(config, cmStateEnums::ImportLibraryArtifact);
     f += "/";
     f += impName;
     gg->AddToManifest(f);
@@ -2907,19 +2918,20 @@ std::string cmGeneratorTarget::GetImportedLibName(
 }
 
 std::string cmGeneratorTarget::GetFullPath(const std::string& config,
-                                           bool implib, bool realname) const
+                                           cmStateEnums::ArtifactType artifact,
+                                           bool realname) const
 {
   if (this->IsImported()) {
-    return this->Target->ImportedGetFullPath(config, implib);
+    return this->Target->ImportedGetFullPath(config, artifact);
   }
-  return this->NormalGetFullPath(config, implib, realname);
+  return this->NormalGetFullPath(config, artifact, realname);
 }
 
-std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
-                                                 bool implib,
-                                                 bool realname) const
+std::string cmGeneratorTarget::NormalGetFullPath(
+  const std::string& config, cmStateEnums::ArtifactType artifact,
+  bool realname) const
 {
-  std::string fpath = this->GetDirectory(config, implib);
+  std::string fpath = this->GetDirectory(config, artifact);
   fpath += "/";
   if (this->IsAppBundleOnApple()) {
     fpath = this->BuildBundleDirectory(fpath, config, FullLevel);
@@ -2927,12 +2939,18 @@ std::string cmGeneratorTarget::NormalGetFullPath(const 
std::string& config,
   }
 
   // Add the full name of the target.
-  if (implib) {
-    fpath += this->GetFullName(config, true);
-  } else if (realname) {
-    fpath += this->NormalGetRealName(config);
-  } else {
-    fpath += this->GetFullName(config, false);
+  switch (artifact) {
+    case cmStateEnums::RuntimeBinaryArtifact:
+      if (realname) {
+        fpath += this->NormalGetRealName(config);
+      } else {
+        fpath +=
+          this->GetFullName(config, cmStateEnums::RuntimeBinaryArtifact);
+      }
+      break;
+    case cmStateEnums::ImportLibraryArtifact:
+      fpath += this->GetFullName(config, cmStateEnums::ImportLibraryArtifact);
+      break;
   }
   return fpath;
 }
@@ -3009,7 +3027,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& 
name, std::string& soName,
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+                            prefix, base, suffix);
 
   // The library name.
   name = prefix + base + suffix;
@@ -3034,7 +3053,8 @@ void cmGeneratorTarget::GetLibraryNames(std::string& 
name, std::string& soName,
   // The import library name.
   if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
       this->GetType() == cmStateEnums::MODULE_LIBRARY) {
-    impName = this->GetFullNameInternal(config, true);
+    impName =
+      this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
   } else {
     impName = "";
   }
@@ -3075,7 +3095,8 @@ void cmGeneratorTarget::GetExecutableNames(std::string& 
name,
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+                            prefix, base, suffix);
 
   // The executable name.
   name = prefix + base + suffix;
@@ -3095,19 +3116,20 @@ void cmGeneratorTarget::GetExecutableNames(std::string& 
name,
 #endif
 
   // The import library name.
-  impName = this->GetFullNameInternal(config, true);
+  impName =
+    this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact);
 
   // The program database file name.
   pdbName = this->GetPDBName(config);
 }
 
-std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config,
-                                                   bool implib) const
+std::string cmGeneratorTarget::GetFullNameInternal(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->GetFullNameInternal(config, implib, prefix, base, suffix);
+  this->GetFullNameInternal(config, artifact, prefix, base, suffix);
   return prefix + base + suffix;
 }
 
@@ -3116,22 +3138,21 @@ const char* cmGeneratorTarget::ImportedGetLocation(
 {
   static std::string location;
   assert(this->IsImported());
-  location = this->Target->ImportedGetFullPath(config, false);
+  location = this->Target->ImportedGetFullPath(
+    config, cmStateEnums::RuntimeBinaryArtifact);
   return location.c_str();
 }
 
-std::string cmGeneratorTarget::GetFullNameImported(const std::string& config,
-                                                   bool implib) const
+std::string cmGeneratorTarget::GetFullNameImported(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   return cmSystemTools::GetFilenameName(
-    this->Target->ImportedGetFullPath(config, implib));
+    this->Target->ImportedGetFullPath(config, artifact));
 }
 
-void cmGeneratorTarget::GetFullNameInternal(const std::string& config,
-                                            bool implib,
-                                            std::string& outPrefix,
-                                            std::string& outBase,
-                                            std::string& outSuffix) const
+void cmGeneratorTarget::GetFullNameInternal(
+  const std::string& config, cmStateEnums::ArtifactType artifact,
+  std::string& outPrefix, std::string& outBase, std::string& outSuffix) const
 {
   // Use just the target name for non-main target types.
   if (this->GetType() != cmStateEnums::STATIC_LIBRARY &&
@@ -3144,9 +3165,12 @@ void cmGeneratorTarget::GetFullNameInternal(const 
std::string& config,
     return;
   }
 
+  const bool isImportedLibraryArtifact =
+    (artifact == cmStateEnums::ImportLibraryArtifact);
+
   // Return an empty name for the import library if this platform
   // does not support import libraries.
-  if (implib &&
+  if (isImportedLibraryArtifact &&
       !this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) {
     outPrefix = "";
     outBase = "";
@@ -3159,14 +3183,16 @@ void cmGeneratorTarget::GetFullNameInternal(const 
std::string& config,
   if (this->GetType() != cmStateEnums::SHARED_LIBRARY &&
       this->GetType() != cmStateEnums::MODULE_LIBRARY &&
       this->GetType() != cmStateEnums::EXECUTABLE) {
-    implib = false;
+    artifact = cmStateEnums::RuntimeBinaryArtifact;
   }
 
   // Compute the full name for main target types.
-  const char* targetPrefix = (implib ? this->GetProperty("IMPORT_PREFIX")
-                                     : this->GetProperty("PREFIX"));
-  const char* targetSuffix = (implib ? this->GetProperty("IMPORT_SUFFIX")
-                                     : this->GetProperty("SUFFIX"));
+  const char* targetPrefix =
+    (isImportedLibraryArtifact ? this->GetProperty("IMPORT_PREFIX")
+                               : this->GetProperty("PREFIX"));
+  const char* targetSuffix =
+    (isImportedLibraryArtifact ? this->GetProperty("IMPORT_SUFFIX")
+                               : this->GetProperty("SUFFIX"));
   const char* configPostfix = CM_NULLPTR;
   if (!config.empty()) {
     std::string configProp = cmSystemTools::UpperCase(config);
@@ -3178,8 +3204,8 @@ void cmGeneratorTarget::GetFullNameInternal(const 
std::string& config,
       configPostfix = CM_NULLPTR;
     }
   }
-  const char* prefixVar = this->Target->GetPrefixVariableInternal(implib);
-  const char* suffixVar = this->Target->GetSuffixVariableInternal(implib);
+  const char* prefixVar = this->Target->GetPrefixVariableInternal(artifact);
+  const char* suffixVar = this->Target->GetSuffixVariableInternal(artifact);
 
   // Check for language-specific default prefix and suffix.
   std::string ll = this->GetLinkerLanguage(config);
@@ -3223,14 +3249,15 @@ void cmGeneratorTarget::GetFullNameInternal(const 
std::string& config,
   outPrefix = targetPrefix ? targetPrefix : "";
 
   // Append the target name or property-specified name.
-  outBase += this->GetOutputName(config, implib);
+  outBase += this->GetOutputName(config, artifact);
 
   // Append the per-configuration postfix.
   outBase += configPostfix ? configPostfix : "";
 
   // Name shared libraries with their version number on some platforms.
   if (const char* soversion = this->GetProperty("SOVERSION")) {
-    if (this->GetType() == cmStateEnums::SHARED_LIBRARY && !implib &&
+    if (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
+        !isImportedLibraryArtifact &&
         this->Makefile->IsOn("CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION")) {
       outBase += "-";
       outBase += soversion;
@@ -3252,7 +3279,8 @@ std::string cmGeneratorTarget::GetPDBName(const 
std::string& config) const
   std::string prefix;
   std::string base;
   std::string suffix;
-  this->GetFullNameInternal(config, false, prefix, base, suffix);
+  this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact,
+                            prefix, base, suffix);
 
   std::vector<std::string> props;
   std::string configUpper = cmSystemTools::UpperCase(config);
@@ -4404,26 +4432,31 @@ const cmLinkInterfaceLibraries* 
cmGeneratorTarget::GetLinkInterfaceLibraries(
   return iface.Exists ? &iface : CM_NULLPTR;
 }
 
-std::string cmGeneratorTarget::GetDirectory(const std::string& config,
-                                            bool implib) const
+std::string cmGeneratorTarget::GetDirectory(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   if (this->IsImported()) {
     // Return the directory from which the target is imported.
     return cmSystemTools::GetFilenamePath(
-      this->Target->ImportedGetFullPath(config, implib));
+      this->Target->ImportedGetFullPath(config, artifact));
   }
   if (OutputInfo const* info = this->GetOutputInfo(config)) {
     // Return the directory in which the target will be built.
-    return implib ? info->ImpDir : info->OutDir;
+    switch (artifact) {
+      case cmStateEnums::RuntimeBinaryArtifact:
+        return info->OutDir;
+      case cmStateEnums::ImportLibraryArtifact:
+        return info->ImpDir;
+    }
   }
   return "";
 }
 
-bool cmGeneratorTarget::UsesDefaultOutputDir(const std::string& config,
-                                             bool implib) const
+bool cmGeneratorTarget::UsesDefaultOutputDir(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   std::string dir;
-  return this->ComputeOutputDir(config, implib, dir);
+  return this->ComputeOutputDir(config, artifact, dir);
 }
 
 cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
@@ -4457,8 +4490,10 @@ cmGeneratorTarget::OutputInfo const* 
cmGeneratorTarget::GetOutputInfo(
     i = this->OutputInfoMap.insert(entry).first;
 
     // Compute output directories.
-    this->ComputeOutputDir(config, false, info.OutDir);
-    this->ComputeOutputDir(config, true, info.ImpDir);
+    this->ComputeOutputDir(config, cmStateEnums::RuntimeBinaryArtifact,
+                           info.OutDir);
+    this->ComputeOutputDir(config, cmStateEnums::ImportLibraryArtifact,
+                           info.ImpDir);
     if (!this->ComputePDBOutputDir("PDB", config, info.PdbDir)) {
       info.PdbDir = info.OutDir;
     }
@@ -4478,14 +4513,15 @@ cmGeneratorTarget::OutputInfo const* 
cmGeneratorTarget::GetOutputInfo(
 }
 
 bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
-                                         bool implib, std::string& out) const
+                                         cmStateEnums::ArtifactType artifact,
+                                         std::string& out) const
 {
   bool usesDefaultOutputDir = false;
   std::string conf = config;
 
   // Look for a target property defining the target output directory
   // based on the target type.
-  std::string targetTypeName = this->GetOutputTargetType(implib);
+  std::string targetTypeName = this->GetOutputTargetType(artifact);
   const char* propertyName = CM_NULLPTR;
   std::string propertyNameStr = targetTypeName;
   if (!propertyNameStr.empty()) {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 5b903de..3a0d23f 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -203,9 +203,12 @@ public:
 
   /** Get the full path to the target according to the settings in its
       makefile and the configuration type.  */
-  std::string GetFullPath(const std::string& config = "", bool implib = false,
-                          bool realname = false) const;
-  std::string NormalGetFullPath(const std::string& config, bool implib,
+  std::string GetFullPath(
+    const std::string& config = "",
+    cmStateEnums::ArtifactType artifact = cmStateEnums::RuntimeBinaryArtifact,
+    bool realname = false) const;
+  std::string NormalGetFullPath(const std::string& config,
+                                cmStateEnums::ArtifactType artifact,
                                 bool realname) const;
   std::string NormalGetRealName(const std::string& config) const;
 
@@ -233,7 +236,8 @@ public:
   /** Get the full name of the target according to the settings in its
       makefile.  */
   std::string GetFullName(const std::string& config = "",
-                          bool implib = false) const;
+                          cmStateEnums::ArtifactType artifact =
+                            cmStateEnums::RuntimeBinaryArtifact) const;
 
   /** @return the Mac framework directory without the base. */
   std::string GetFrameworkDirectory(const std::string& config,
@@ -278,7 +282,8 @@ public:
   void GetFullNameComponents(std::string& prefix, std::string& base,
                              std::string& suffix,
                              const std::string& config = "",
-                             bool implib = false) const;
+                             cmStateEnums::ArtifactType artifact =
+                               cmStateEnums::RuntimeBinaryArtifact) const;
 
   /** Append to @a base the bundle directory hierarchy up to a certain @a level
    * and return it. */
@@ -287,8 +292,8 @@ public:
                                    BundleDirectoryLevel level) const;
 
   /** @return the mac content directory for this target. */
-  std::string GetMacContentDirectory(const std::string& config = CM_NULLPTR,
-                                     bool implib = false) const;
+  std::string GetMacContentDirectory(
+    const std::string& config, cmStateEnums::ArtifactType artifact) const;
 
   /** @return folder prefix for IDEs. */
   std::string GetEffectiveFolderName() const;
@@ -355,7 +360,7 @@ public:
     std::vector<cmGeneratorTarget*>& objlibs) const;
 
   std::string GetFullNameImported(const std::string& config,
-                                  bool implib) const;
+                                  cmStateEnums::ArtifactType artifact) const;
 
   /** Get source files common to all configurations and diagnose cases
       with per-config sources.  Excludes sources added by a TARGET_OBJECTS
@@ -415,7 +420,8 @@ public:
       subdirectory for that configuration.  Otherwise just the canonical
       output directory is given.  */
   std::string GetDirectory(const std::string& config = "",
-                           bool implib = false) const;
+                           cmStateEnums::ArtifactType artifact =
+                             cmStateEnums::RuntimeBinaryArtifact) const;
 
   /** Get the directory in which to place the target compiler .pdb file.
       If the configuration name is given then the generator will add its
@@ -429,7 +435,8 @@ public:
 
   /** Return whether this target uses the default value for its output
       directory.  */
-  bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
+  bool UsesDefaultOutputDir(const std::string& config,
+                            cmStateEnums::ArtifactType artifact) const;
 
   // Cache target output paths for each configuration.
   struct OutputInfo
@@ -470,7 +477,8 @@ public:
   std::string GetCompilePDBPath(const std::string& config = "") const;
 
   // Get the target base name.
-  std::string GetOutputName(const std::string& config, bool implib) const;
+  std::string GetOutputName(const std::string& config,
+                            cmStateEnums::ArtifactType artifact) const;
 
   void AddSource(const std::string& src);
   void AddTracedSources(std::vector<std::string> const& srcs);
@@ -653,8 +661,9 @@ private:
   mutable std::map<std::string, bool> DebugCompatiblePropertiesDone;
 
   std::string GetFullNameInternal(const std::string& config,
-                                  bool implib) const;
-  void GetFullNameInternal(const std::string& config, bool implib,
+                                  cmStateEnums::ArtifactType artifact) const;
+  void GetFullNameInternal(const std::string& config,
+                           cmStateEnums::ArtifactType artifact,
                            std::string& outPrefix, std::string& outBase,
                            std::string& outSuffix) const;
 
@@ -662,7 +671,7 @@ private:
   mutable LinkClosureMapType LinkClosureMap;
 
   // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
-  const char* GetOutputTargetType(bool implib) const;
+  const char* GetOutputTargetType(cmStateEnums::ArtifactType artifact) const;
 
   void ComputeVersionedName(std::string& vName, std::string const& prefix,
                             std::string const& base, std::string const& suffix,
@@ -788,7 +797,8 @@ private:
 
   cmLinkImplementationLibraries const* GetLinkImplementationLibrariesInternal(
     const std::string& config, const cmGeneratorTarget* head) const;
-  bool ComputeOutputDir(const std::string& config, bool implib,
+  bool ComputeOutputDir(const std::string& config,
+                        cmStateEnums::ArtifactType artifact,
                         std::string& out) const;
 
   typedef std::map<std::string, OutputInfo> OutputInfoMapType;
@@ -800,7 +810,7 @@ private:
   void ComputeModuleDefinitionInfo(std::string const& config,
                                    ModuleDefinitionInfo& info) const;
 
-  typedef std::pair<std::string, bool> OutputNameKey;
+  typedef std::pair<std::string, cmStateEnums::ArtifactType> OutputNameKey;
   typedef std::map<OutputNameKey, std::string> OutputNameMapType;
   mutable OutputNameMapType OutputNameMap;
   mutable std::set<cmLinkItem> UtilityItems;
diff --git a/Source/cmGlobalNinjaGenerator.cxx 
b/Source/cmGlobalNinjaGenerator.cxx
index aae01ca..5a57865 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -983,8 +983,8 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
     case cmStateEnums::SHARED_LIBRARY:
     case cmStateEnums::STATIC_LIBRARY:
     case cmStateEnums::MODULE_LIBRARY: {
-      outputs.push_back(this->ConvertToNinjaPath(
-        target->GetFullPath(configName, false, realname)));
+      outputs.push_back(this->ConvertToNinjaPath(target->GetFullPath(
+        configName, cmStateEnums::RuntimeBinaryArtifact, realname)));
       break;
     }
     case cmStateEnums::OBJECT_LIBRARY:
diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 8c1c0e7..cd1b440 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1817,7 +1817,8 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
       gtgt->GetType() == cmStateEnums::MODULE_LIBRARY ||
       gtgt->GetType() == cmStateEnums::EXECUTABLE) {
     if (this->XcodeVersion >= 21) {
-      if (!gtgt->UsesDefaultOutputDir(configName, false)) {
+      if (!gtgt->UsesDefaultOutputDir(configName,
+                                      cmStateEnums::RuntimeBinaryArtifact)) {
         std::string pncdir = gtgt->GetDirectory(configName);
         buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
                                     this->CreateString(pncdir));
diff --git a/Source/cmInstallTargetGenerator.cxx 
b/Source/cmInstallTargetGenerator.cxx
index 6ecf42d..1827ed3 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -103,7 +103,10 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
     fromDirConfig += cmake::GetCMakeFilesDirectory();
     fromDirConfig += "/CMakeRelink.dir/";
   } else {
-    fromDirConfig = this->Target->GetDirectory(config, this->ImportLibrary);
+    cmStateEnums::ArtifactType artifact = this->ImportLibrary
+      ? cmStateEnums::ImportLibraryArtifact
+      : cmStateEnums::RuntimeBinaryArtifact;
+    fromDirConfig = this->Target->GetDirectory(config, artifact);
     fromDirConfig += "/";
   }
 
diff --git a/Source/cmLocalVisualStudio7Generator.cxx 
b/Source/cmLocalVisualStudio7Generator.cxx
index a36e1f6..bfcc75d 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1133,7 +1133,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
       if (stackVal) {
         fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"\n";
       }
-      temp = target->GetDirectory(configName, true);
+      temp =
+        target->GetDirectory(configName, cmStateEnums::ImportLibraryArtifact);
       temp += "/";
       temp += targetNameImport;
       fout << "\t\t\t\tImportLibrary=\""
@@ -1231,7 +1232,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
       if (stackVal) {
         fout << "\t\t\t\tStackReserveSize=\"" << stackVal << "\"";
       }
-      temp = target->GetDirectory(configName, true);
+      temp =
+        target->GetDirectory(configName, cmStateEnums::ImportLibraryArtifact);
       temp += "/";
       temp += targetNameImport;
       fout << "\t\t\t\tImportLibrary=\""
diff --git a/Source/cmLocalVisualStudioGenerator.cxx 
b/Source/cmLocalVisualStudioGenerator.cxx
index e20fe50..3d7b60b 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -80,8 +80,10 @@ 
cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
       !(isFortran && target->GetType() == cmStateEnums::SHARED_LIBRARY)) {
     return pcc;
   }
-  std::string outDir = target->GetDirectory(config, false);
-  std::string impDir = target->GetDirectory(config, true);
+  std::string outDir =
+    target->GetDirectory(config, cmStateEnums::RuntimeBinaryArtifact);
+  std::string impDir =
+    target->GetDirectory(config, cmStateEnums::ImportLibraryArtifact);
   if (impDir == outDir) {
     return pcc;
   }
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx 
b/Source/cmMakefileExecutableTargetGenerator.cxx
index 493f474..a93b42d 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -21,6 +21,7 @@
 #include "cmState.h"
 #include "cmStateDirectory.h"
 #include "cmStateSnapshot.h"
+#include "cmStateTypes.h"
 #include "cmSystemTools.h"
 #include "cm_auto_ptr.hxx"
 #include "cmake.h"
@@ -332,7 +333,8 @@ void 
cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   } else {
     cmSystemTools::MakeDirectory(outpath.c_str());
     if (!targetNameImport.empty()) {
-      outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
+      outpathImp = this->GeneratorTarget->GetDirectory(
+        this->ConfigName, cmStateEnums::ImportLibraryArtifact);
       cmSystemTools::MakeDirectory(outpathImp.c_str());
       outpathImp += "/";
     }
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx 
b/Source/cmMakefileLibraryTargetGenerator.cxx
index cc8a6b3..e017b29 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -514,7 +514,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
     cmSystemTools::MakeDirectory(outpath.c_str());
     outpath += "/";
     if (!targetNameImport.empty()) {
-      outpathImp = this->GeneratorTarget->GetDirectory(this->ConfigName, true);
+      outpathImp = this->GeneratorTarget->GetDirectory(
+        this->ConfigName, cmStateEnums::ImportLibraryArtifact);
       cmSystemTools::MakeDirectory(outpathImp.c_str());
       outpathImp += "/";
     }
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index ed38024..ac5734c 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -509,8 +509,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
         this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY ||
         this->GeneratorTarget->GetType() == cmStateEnums::SHARED_LIBRARY ||
         this->GeneratorTarget->GetType() == cmStateEnums::MODULE_LIBRARY) {
-      targetFullPathReal =
-        this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
+      targetFullPathReal = this->GeneratorTarget->GetFullPath(
+        this->ConfigName, cmStateEnums::RuntimeBinaryArtifact, true);
       targetFullPathPDB =
         this->GeneratorTarget->GetPDBDirectory(this->ConfigName);
       targetFullPathPDB += "/";
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index aaeb659..97b7f2a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -491,10 +491,9 @@ std::vector<std::string> 
cmNinjaNormalTargetGenerator::ComputeLinkCmd()
         cmGeneratorTarget& gt = *this->GetGeneratorTarget();
         const std::string cfgName = this->GetConfigName();
         std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
-        std::string targetOutputReal =
-          this->ConvertToNinjaPath(gt.GetFullPath(cfgName,
-                                                  /*implib=*/false,
-                                                  /*realname=*/true));
+        std::string targetOutputReal = this->ConvertToNinjaPath(
+          gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
+                         /*realname=*/true));
         cmakeCommand += targetOutputReal;
         cmakeCommand += " || true";
         linkCmds.push_back(cmakeCommand);
@@ -616,9 +615,8 @@ void 
cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
   std::string const targetOutputReal = ConvertToNinjaPath(
     genTarget.ObjectDirectory + "cmake_device_link" + objExt);
 
-  std::string const targetOutputImplib =
-    ConvertToNinjaPath(genTarget.GetFullPath(cfgName,
-                                             /*implib=*/true));
+  std::string const targetOutputImplib = ConvertToNinjaPath(
+    genTarget.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
 
   this->DeviceLinkObject = targetOutputReal;
 
@@ -788,13 +786,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
   cmGeneratorTarget& gt = *this->GetGeneratorTarget();
   const std::string cfgName = this->GetConfigName();
   std::string targetOutput = ConvertToNinjaPath(gt.GetFullPath(cfgName));
-  std::string targetOutputReal =
-    ConvertToNinjaPath(gt.GetFullPath(cfgName,
-                                      /*implib=*/false,
-                                      /*realname=*/true));
-  std::string targetOutputImplib =
-    ConvertToNinjaPath(gt.GetFullPath(cfgName,
-                                      /*implib=*/true));
+  std::string targetOutputReal = ConvertToNinjaPath(
+    gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
+                   /*realname=*/true));
+  std::string targetOutputImplib = ConvertToNinjaPath(
+    gt.GetFullPath(cfgName, cmStateEnums::ImportLibraryArtifact));
 
   if (gt.IsAppBundleOnApple()) {
     // Create the app bundle
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index c09feef..332fa83 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -7,6 +7,7 @@
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmStateTypes.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
 
@@ -213,8 +214,8 @@ std::string 
cmOSXBundleGenerator::InitMacOSXContentDirectory(
 {
   // Construct the full path to the content subdirectory.
 
-  std::string macdir = this->GT->GetMacContentDirectory(this->ConfigName,
-                                                        /*implib*/ false);
+  std::string macdir = this->GT->GetMacContentDirectory(
+    this->ConfigName, cmStateEnums::RuntimeBinaryArtifact);
   macdir += "/";
   macdir += pkgloc;
   cmSystemTools::MakeDirectory(macdir.c_str());
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index a5c1a23..8227ab7 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -763,9 +763,11 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
 
   if (target->HaveWellDefinedOutputFiles()) {
     Json::Value artifacts = Json::arrayValue;
-    artifacts.append(target->GetFullPath(config, false));
+    artifacts.append(
+      target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact));
     if (target->IsDLLPlatform()) {
-      artifacts.append(target->GetFullPath(config, true));
+      artifacts.append(
+        target->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
       const cmGeneratorTarget::OutputInfo* output =
         target->GetOutputInfo(config);
       if (output && !output->PdbDir.empty()) {
diff --git a/Source/cmStateTypes.h b/Source/cmStateTypes.h
index b2b12b4..7d6158e 100644
--- a/Source/cmStateTypes.h
+++ b/Source/cmStateTypes.h
@@ -53,6 +53,12 @@ enum CacheEntryType
   STATIC,
   UNINITIALIZED
 };
+
+enum ArtifactType
+{
+  RuntimeBinaryArtifact,
+  ImportLibraryArtifact
+};
 }
 
 #endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0b1bb06..bda1d95 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -35,7 +35,7 @@ const char* 
cmTargetPropertyComputer::ComputeLocationForBuild<cmTarget>(
 {
   static std::string loc;
   if (tgt->IsImported()) {
-    loc = tgt->ImportedGetFullPath("", false);
+    loc = tgt->ImportedGetFullPath("", cmStateEnums::RuntimeBinaryArtifact);
     return loc.c_str();
   }
 
@@ -54,7 +54,8 @@ const char* 
cmTargetPropertyComputer::ComputeLocation<cmTarget>(
 {
   static std::string loc;
   if (tgt->IsImported()) {
-    loc = tgt->ImportedGetFullPath(config, false);
+    loc =
+      tgt->ImportedGetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
     return loc.c_str();
   }
 
@@ -63,7 +64,7 @@ const char* 
cmTargetPropertyComputer::ComputeLocation<cmTarget>(
     gg->CreateGenerationObjects();
   }
   cmGeneratorTarget* gt = gg->FindGeneratorTarget(tgt->GetName());
-  loc = gt->GetFullPath(config, false);
+  loc = gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact);
   return loc.c_str();
 }
 
@@ -1294,58 +1295,88 @@ bool cmTarget::GetPropertyAsBool(const std::string& 
prop) const
   return cmSystemTools::IsOn(this->GetProperty(prop));
 }
 
-const char* cmTarget::GetSuffixVariableInternal(bool implib) const
+const char* cmTarget::GetSuffixVariableInternal(
+  cmStateEnums::ArtifactType artifact) const
 {
   switch (this->GetType()) {
     case cmStateEnums::STATIC_LIBRARY:
       return "CMAKE_STATIC_LIBRARY_SUFFIX";
     case cmStateEnums::SHARED_LIBRARY:
-      return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
-                     : "CMAKE_SHARED_LIBRARY_SUFFIX");
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          return "CMAKE_SHARED_LIBRARY_SUFFIX";
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+      }
+      break;
     case cmStateEnums::MODULE_LIBRARY:
-      return (implib ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
-                     : "CMAKE_SHARED_MODULE_SUFFIX");
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          return "CMAKE_SHARED_MODULE_SUFFIX";
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+      }
+      break;
     case cmStateEnums::EXECUTABLE:
-      return (implib
-                ? "CMAKE_IMPORT_LIBRARY_SUFFIX"
-                // Android GUI application packages store the native
-                // binary as a shared library.
-                : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
-                     ? "CMAKE_SHARED_LIBRARY_SUFFIX"
-                     : "CMAKE_EXECUTABLE_SUFFIX"));
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          // Android GUI application packages store the native
+          // binary as a shared library.
+          return (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+                    ? "CMAKE_SHARED_LIBRARY_SUFFIX"
+                    : "CMAKE_EXECUTABLE_SUFFIX");
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_SUFFIX";
+      }
+      break;
     default:
       break;
   }
   return "";
 }
 
-const char* cmTarget::GetPrefixVariableInternal(bool implib) const
+const char* cmTarget::GetPrefixVariableInternal(
+  cmStateEnums::ArtifactType artifact) const
 {
   switch (this->GetType()) {
     case cmStateEnums::STATIC_LIBRARY:
       return "CMAKE_STATIC_LIBRARY_PREFIX";
     case cmStateEnums::SHARED_LIBRARY:
-      return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX"
-                     : "CMAKE_SHARED_LIBRARY_PREFIX");
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          return "CMAKE_SHARED_LIBRARY_PREFIX";
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_PREFIX";
+      }
+      break;
     case cmStateEnums::MODULE_LIBRARY:
-      return (implib ? "CMAKE_IMPORT_LIBRARY_PREFIX"
-                     : "CMAKE_SHARED_MODULE_PREFIX");
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          return "CMAKE_SHARED_MODULE_PREFIX";
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_PREFIX";
+      }
+      break;
     case cmStateEnums::EXECUTABLE:
-      return (implib
-                ? "CMAKE_IMPORT_LIBRARY_PREFIX"
-                // Android GUI application packages store the native
-                // binary as a shared library.
-                : (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
-                     ? "CMAKE_SHARED_LIBRARY_PREFIX"
-                     : ""));
+      switch (artifact) {
+        case cmStateEnums::RuntimeBinaryArtifact:
+          // Android GUI application packages store the native
+          // binary as a shared library.
+          return (this->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI")
+                    ? "CMAKE_SHARED_LIBRARY_PREFIX"
+                    : "");
+        case cmStateEnums::ImportLibraryArtifact:
+          return "CMAKE_IMPORT_LIBRARY_PREFIX";
+      }
+      break;
     default:
       break;
   }
   return "";
 }
 
-std::string cmTarget::ImportedGetFullPath(const std::string& config,
-                                          bool pimplib) const
+std::string cmTarget::ImportedGetFullPath(
+  const std::string& config, cmStateEnums::ArtifactType artifact) const
 {
   assert(this->IsImported());
 
@@ -1364,32 +1395,37 @@ std::string cmTarget::ImportedGetFullPath(const 
std::string& config,
 
   if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
       this->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
-    if (!pimplib) {
-      if (loc) {
-        result = loc;
-      } else {
-        std::string impProp = "IMPORTED_LOCATION";
-        impProp += suffix;
-        if (const char* config_location = this->GetProperty(impProp)) {
-          result = config_location;
-        } else if (const char* location =
-                     this->GetProperty("IMPORTED_LOCATION")) {
-          result = location;
+    switch (artifact) {
+      case cmStateEnums::RuntimeBinaryArtifact:
+        if (loc) {
+          result = loc;
+        } else {
+          std::string impProp = "IMPORTED_LOCATION";
+          impProp += suffix;
+          if (const char* config_location = this->GetProperty(impProp)) {
+            result = config_location;
+          } else if (const char* location =
+                       this->GetProperty("IMPORTED_LOCATION")) {
+            result = location;
+          }
         }
-      }
-    } else {
-      if (imp) {
-        result = imp;
-      } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
-                 this->IsExecutableWithExports()) {
-        std::string impProp = "IMPORTED_IMPLIB";
-        impProp += suffix;
-        if (const char* config_implib = this->GetProperty(impProp)) {
-          result = config_implib;
-        } else if (const char* implib = this->GetProperty("IMPORTED_IMPLIB")) {
-          result = implib;
+        break;
+
+      case cmStateEnums::ImportLibraryArtifact:
+        if (imp) {
+          result = imp;
+        } else if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
+                   this->IsExecutableWithExports()) {
+          std::string impProp = "IMPORTED_IMPLIB";
+          impProp += suffix;
+          if (const char* config_implib = this->GetProperty(impProp)) {
+            result = config_implib;
+          } else if (const char* implib =
+                       this->GetProperty("IMPORTED_IMPLIB")) {
+            result = implib;
+          }
         }
-      }
+        break;
     }
   }
 
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index c67143a..1f00c01 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -267,11 +267,13 @@ public:
   };
 
   std::string ImportedGetFullPath(const std::string& config,
-                                  bool implib) const;
+                                  cmStateEnums::ArtifactType artifact) const;
 
 private:
-  const char* GetSuffixVariableInternal(bool implib) const;
-  const char* GetPrefixVariableInternal(bool implib) const;
+  const char* GetSuffixVariableInternal(
+    cmStateEnums::ArtifactType artifact) const;
+  const char* GetPrefixVariableInternal(
+    cmStateEnums::ArtifactType artifact) const;
 
   // Use a makefile variable to set a default for the given property.
   // If the variable is not defined use the given default instead.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index f0f04a8..18b93f6 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1051,8 +1051,8 @@ void 
cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
 
   std::string postfixName = cmSystemTools::UpperCase(config);
   postfixName += "_POSTFIX";
-  std::string assemblyName =
-    this->GeneratorTarget->GetOutputName(config, false);
+  std::string assemblyName = this->GeneratorTarget->GetOutputName(
+    config, cmStateEnums::RuntimeBinaryArtifact);
   if (const char* postfix = this->GeneratorTarget->GetProperty(postfixName)) {
     assemblyName += postfix;
   }
@@ -3014,8 +3014,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
     std::string pdb = this->GeneratorTarget->GetPDBDirectory(config.c_str());
     pdb += "/";
     pdb += targetNamePDB;
-    std::string imLib =
-      this->GeneratorTarget->GetDirectory(config.c_str(), true);
+    std::string imLib = this->GeneratorTarget->GetDirectory(
+      config.c_str(), cmStateEnums::ImportLibraryArtifact);
     imLib += "/";
     imLib += targetNameImport;
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e8b77084dfaaa211913acaec871e8f9fc0cedd88
commit e8b77084dfaaa211913acaec871e8f9fc0cedd88
Author:     Jan Mrázek <em...@honzamrazek.cz>
AuthorDate: Fri Apr 14 01:15:03 2017 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Thu Apr 20 09:15:59 2017 -0400

    FindwxWidgets: Verify existence of libraries reported by wx-config
    
    When the Ubuntu package `libwxgtk3-dev` is not installed, FindwxWidgets
    succeeds even the required libraries are not actually found. The reason
    for that is that `wx-config` does not perform any kind of check and uses
    hard-coded values.  This affects e.g. KiCAD build process and makes it
    fail with a confusing error message [1].  The solution is to check for
    presence of every library file obtained from `wx-config`.
    
    [1] https://bugs.launchpad.net/kicad/+bug/1630020

diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index bc906e5..af4daf0 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -893,6 +893,28 @@ else()
   endif()
 endif()
 
+# Check that all libraries are present, as wx-config does not check it
+set(_wx_lib_missing "")
+foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
+  if("${_wx_lib_}" MATCHES "^-l(.*)")
+    set(_wx_lib_name "${CMAKE_MATCH_1}")
+    unset(_wx_lib_found CACHE)
+    find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS 
${wxWidgets_LIBRARY_DIRS})
+    if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
+      list(APPEND _wx_lib_missing ${_wx_lib_name})
+    endif()
+    unset(_wx_lib_found CACHE)
+  endif()
+endforeach()
+
+if (_wx_lib_missing)
+  string(REPLACE ";" " " _wx_lib_missing "${_wx_lib_missing}")
+  DBG_MSG_V("wxWidgets not found due to following missing libraries: 
${_wx_lib_missing}")
+  set(wxWidgets_FOUND FALSE)
+  unset(wxWidgets_LIBRARIES)
+endif()
+unset(_wx_lib_missing)
+
 # Check if a specfic version was requested by find_package().
 if(wxWidgets_FOUND)
   find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} 
NO_DEFAULT_PATH)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffdde4a9aeb7a93f1f608d92e15540a7ca43a1e6
commit ffdde4a9aeb7a93f1f608d92e15540a7ca43a1e6
Author:     Gregor Jasny <gja...@googlemail.com>
AuthorDate: Wed Apr 19 22:17:35 2017 +0200
Commit:     Gregor Jasny <gja...@googlemail.com>
CommitDate: Wed Apr 19 22:28:50 2017 +0200

    Xcode: Use SYSTEM_HEADER_SEARCH_PATHS attribute for system includes
    
    Closes #16795

diff --git a/Source/cmGlobalXCodeGenerator.cxx 
b/Source/cmGlobalXCodeGenerator.cxx
index 8c1c0e7..6118c73 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2009,6 +2009,10 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
 
   BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
   BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
+  BuildObjectListOrString sysdirs(this, this->XcodeVersion >= 30);
+  BuildObjectListOrString sysfdirs(this, this->XcodeVersion >= 30);
+  const bool emitSystemIncludes = this->XcodeVersion >= 83;
+
   std::vector<std::string> includes;
   this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt, "C",
                                                      configName);
@@ -2022,11 +2026,22 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
       frameworkDir += "/../";
       frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
       if (emitted.insert(frameworkDir).second) {
-        fdirs.Add(this->XCodeEscapePath(frameworkDir));
+        std::string incpath = this->XCodeEscapePath(frameworkDir);
+        if (emitSystemIncludes &&
+            gtgt->IsSystemIncludeDirectory(frameworkDir, configName)) {
+          sysfdirs.Add(incpath);
+        } else {
+          fdirs.Add(incpath);
+        }
       }
     } else {
       std::string incpath = this->XCodeEscapePath(*i);
-      dirs.Add(incpath);
+      if (emitSystemIncludes &&
+          gtgt->IsSystemIncludeDirectory(*i, configName)) {
+        sysdirs.Add(incpath);
+      } else {
+        dirs.Add(incpath);
+      }
     }
   }
   // Add framework search paths needed for linking.
@@ -2035,7 +2050,13 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
     for (std::vector<std::string>::const_iterator fdi = fwDirs.begin();
          fdi != fwDirs.end(); ++fdi) {
       if (emitted.insert(*fdi).second) {
-        fdirs.Add(this->XCodeEscapePath(*fdi));
+        std::string incpath = this->XCodeEscapePath(*fdi);
+        if (emitSystemIncludes &&
+            gtgt->IsSystemIncludeDirectory(*fdi, configName)) {
+          sysfdirs.Add(incpath);
+        } else {
+          fdirs.Add(incpath);
+        }
       }
     }
   }
@@ -2045,8 +2066,16 @@ void 
cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   if (!dirs.IsEmpty()) {
     buildSettings->AddAttribute("HEADER_SEARCH_PATHS", dirs.CreateList());
   }
+  if (!sysfdirs.IsEmpty()) {
+    buildSettings->AddAttribute("SYSTEM_FRAMEWORK_SEARCH_PATHS",
+                                sysfdirs.CreateList());
+  }
+  if (!sysdirs.IsEmpty()) {
+    buildSettings->AddAttribute("SYSTEM_HEADER_SEARCH_PATHS",
+                                sysdirs.CreateList());
+  }
 
-  if (this->XcodeVersion >= 60) {
+  if (this->XcodeVersion >= 60 && !emitSystemIncludes) {
     // Add those per-language flags in addition to HEADER_SEARCH_PATHS to gain
     // system include directory awareness. We need to also keep on setting
     // HEADER_SEARCH_PATHS to work around a missing compile options flag for

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbb5c3efe2a17d046506b7c27008c77ea244f0bc
commit bbb5c3efe2a17d046506b7c27008c77ea244f0bc
Author:     Christian Pfeiffer <cpfeif...@live.de>
AuthorDate: Tue Apr 18 23:06:39 2017 +0200
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed Apr 19 11:02:24 2017 -0400

    Ninja,Makefile: Unify command line limit logic
    
    Move the logic to cmSystemTools to be shared among the generators.
    Revise the implementation and add comments justifying each possible
    source for a limit.

diff --git a/Source/cmGlobalNinjaGenerator.cxx 
b/Source/cmGlobalNinjaGenerator.cxx
index aae01ca..a95d4ee 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -246,7 +246,7 @@ void cmGlobalNinjaGenerator::WriteBuild(
   bool useResponseFile = false;
   if (cmdLineLimit < 0 ||
       (cmdLineLimit > 0 &&
-       (args.size() + buildstr.size() + assignments.size()) >
+       (args.size() + buildstr.size() + assignments.size() + 1000) >
          static_cast<size_t>(cmdLineLimit))) {
     variable_assignments.str(std::string());
     cmGlobalNinjaGenerator::WriteVariable(variable_assignments, "RSP_FILE",
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index ed38024..dd5cd7d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -30,10 +30,6 @@
 #include "cm_auto_ptr.hxx"
 #include "cmake.h"
 
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
 cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
   : cmCommonTargetGenerator(target)
   , OSXBundleGenerator(CM_NULLPTR)
@@ -1492,15 +1488,6 @@ void cmMakefileTargetGenerator::CreateLinkScript(
   makefile_depends.push_back(linkScriptName);
 }
 
-static size_t calculateCommandLineLengthLimit()
-{
-#if defined(_SC_ARG_MAX)
-  return ((size_t)sysconf(_SC_ARG_MAX)) - 1000;
-#else
-  return 0;
-#endif
-}
-
 bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
   std::string const& l) const
 {
@@ -1514,7 +1501,7 @@ bool 
cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
   }
 
   // Check for a system limit.
-  if (size_t const limit = calculateCommandLineLengthLimit()) {
+  if (size_t const limit = cmSystemTools::CalculateCommandLineLengthLimit()) {
     // Compute the total length of our list of object files with room
     // for argument separation and quoting.  This does not convert paths
     // relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx 
b/Source/cmNinjaNormalTargetGenerator.cxx
index aaeb659..edab2ba 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -5,11 +5,9 @@
 #include <algorithm>
 #include <assert.h>
 #include <iterator>
-#include <limits>
 #include <map>
 #include <set>
 #include <sstream>
-#include <stddef.h>
 
 #include "cmAlgorithms.h"
 #include "cmCustomCommand.h"
@@ -35,10 +33,6 @@
 #include "cm_auto_ptr.hxx"
 #include "cmake.h"
 
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
 cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
   cmGeneratorTarget* target)
   : cmNinjaTargetGenerator(target)
@@ -546,36 +540,6 @@ std::vector<std::string> 
cmNinjaNormalTargetGenerator::ComputeLinkCmd()
   return std::vector<std::string>();
 }
 
-static int calculateCommandLineLengthLimit(int linkRuleLength)
-{
-  static int const limits[] = {
-#ifdef _WIN32
-    8000,
-#endif
-#if defined(__linux)
-    // #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h
-    ((int)sysconf(_SC_PAGESIZE) * 32) - 1000,
-#endif
-    std::numeric_limits<int>::max()
-  };
-
-  size_t const arrSz = cmArraySize(limits);
-  int sz = *std::min_element(limits, limits + arrSz);
-#if defined(_SC_ARG_MAX)
-  // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
-  int const szArgMax = static_cast<int>(sysconf(_SC_ARG_MAX));
-  // a return value of -1 signifies an unrestricted value
-  if (szArgMax != -1) {
-    sz = std::min(sz, szArgMax - 1000);
-  }
-#endif
-  if (sz == std::numeric_limits<int>::max()) {
-    return 0;
-  }
-
-  return sz - linkRuleLength;
-}
-
 void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
 {
   cmGeneratorTarget& genTarget = *this->GetGeneratorTarget();
@@ -761,8 +725,9 @@ void 
cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
 
   // Device linking currently doesn't support response files so
   // do not check if the user has explicitly forced a response file.
-  int const commandLineLengthLimit = calculateCommandLineLengthLimit(
-    globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule()));
+  int const commandLineLengthLimit =
+    static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
+    globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule());
 
   const std::string rspfile =
     std::string(cmake::GetCMakeFilesDirectoryPostSlash()) +
@@ -1048,8 +1013,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
     !(this->TargetLinkLanguage == "RC" || this->TargetLinkLanguage == "CUDA");
   int commandLineLengthLimit = -1;
   if (!lang_supports_response || !this->ForceResponseFile()) {
-    commandLineLengthLimit = calculateCommandLineLengthLimit(
-      globalGen.GetRuleCmdLength(this->LanguageLinkerRule()));
+    commandLineLengthLimit =
+      static_cast<int>(cmSystemTools::CalculateCommandLineLengthLimit()) -
+      globalGen.GetRuleCmdLength(this->LanguageLinkerRule());
   }
 
   const std::string rspfile =
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 8dc6571..f4de125 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -570,6 +570,46 @@ std::vector<std::string> 
cmSystemTools::ParseArguments(const char* command)
   return args;
 }
 
+size_t cmSystemTools::CalculateCommandLineLengthLimit()
+{
+  size_t sz =
+#ifdef _WIN32
+    // There's a maximum of 65536 bytes and thus 32768 WCHARs on Windows
+    // However, cmd.exe itself can only handle 8191 WCHARs and Ninja for
+    // example uses it to spawn processes.
+    size_t(8191);
+#elif defined(__linux)
+    // MAX_ARG_STRLEN is the maximum length of a string permissible for
+    // the execve() syscall on Linux. It's defined as (PAGE_SIZE * 32)
+    // in Linux's binfmts.h
+    static_cast<size_t>(sysconf(_SC_PAGESIZE) * 32);
+#else
+    size_t(0);
+#endif
+
+#if defined(_SC_ARG_MAX)
+  // ARG_MAX is the maximum size of the command and environment
+  // that can be passed to the exec functions on UNIX.
+  // The value in limits.h does not need to be present and may
+  // depend upon runtime memory constraints, hence sysconf()
+  // should be used to query it.
+  long szArgMax = sysconf(_SC_ARG_MAX);
+  // A return value of -1 signifies an undetermined limit, but
+  // it does not imply an infinite limit, and thus is ignored.
+  if (szArgMax != -1) {
+    // We estimate the size of the environment block to be 1000.
+    // This isn't accurate at all, but leaves some headroom.
+    szArgMax = szArgMax < 1000 ? 0 : szArgMax - 1000;
+#if defined(_WIN32) || defined(__linux)
+    sz = std::min(sz, static_cast<size_t>(szArgMax));
+#else
+    sz = static_cast<size_t>(szArgMax);
+#endif
+  }
+#endif
+  return sz;
+}
+
 bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
                                      std::string* captureStdOut,
                                      std::string* captureStdErr, int* retVal,
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 86d92be..a8a9995 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -253,6 +253,8 @@ public:
   static void ParseUnixCommandLine(const char* command,
                                    std::vector<std::string>& args);
 
+  static size_t CalculateCommandLineLengthLimit();
+
   static void EnableMessages() { s_DisableMessages = false; }
   static void DisableMessages() { s_DisableMessages = true; }
   static void DisableRunCommandOutput() { s_DisableRunCommandOutput = true; }

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

Summary of changes:
 Modules/FindwxWidgets.cmake                    |   22 +++
 Source/cmComputeLinkInformation.cxx            |   20 ++-
 Source/cmExportBuildFileGenerator.cxx          |    9 +-
 Source/cmGeneratorExpressionNode.cxx           |    8 +-
 Source/cmGeneratorTarget.cxx                   |  226 ++++++++++++++----------
 Source/cmGeneratorTarget.h                     |   42 +++--
 Source/cmGlobalNinjaGenerator.cxx              |    6 +-
 Source/cmGlobalXCodeGenerator.cxx              |   40 ++++-
 Source/cmInstallTargetGenerator.cxx            |    5 +-
 Source/cmLocalVisualStudio7Generator.cxx       |    6 +-
 Source/cmLocalVisualStudioGenerator.cxx        |    6 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |    4 +-
 Source/cmMakefileLibraryTargetGenerator.cxx    |    3 +-
 Source/cmMakefileTargetGenerator.cxx           |   19 +-
 Source/cmNinjaNormalTargetGenerator.cxx        |   70 ++------
 Source/cmOSXBundleGenerator.cxx                |    5 +-
 Source/cmServerProtocol.cxx                    |    6 +-
 Source/cmStateTypes.h                          |    6 +
 Source/cmSystemTools.cxx                       |   40 +++++
 Source/cmSystemTools.h                         |    2 +
 Source/cmTarget.cxx                            |  142 +++++++++------
 Source/cmTarget.h                              |    8 +-
 Source/cmVisualStudio10TargetGenerator.cxx     |   17 +-
 23 files changed, 436 insertions(+), 276 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to