summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx (renamed from Source/CPack/cmCPackExtGenerator.cxx)45
-rw-r--r--Source/CPack/cmCPackExternalGenerator.h (renamed from Source/CPack/cmCPackExtGenerator.h)25
-rw-r--r--Source/CPack/cmCPackGeneratorFactory.cxx8
-rw-r--r--Source/cmAddCustomCommandCommand.cxx6
-rw-r--r--Source/cmAddCustomTargetCommand.cxx7
-rw-r--r--Source/cmCustomCommandGenerator.cxx6
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmFileMonitor.cxx3
-rw-r--r--Source/cmGeneratorTarget.cxx28
-rw-r--r--Source/cmGeneratorTarget.h6
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx1
-rw-r--r--Source/cmLocalNinjaGenerator.cxx4
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx1
-rw-r--r--Source/cmQtAutoGenInitializer.cxx11
-rw-r--r--Source/cmQtAutoGenInitializer.h1
-rw-r--r--Source/cmTarget.cxx1
-rw-r--r--Source/cmTargetPropCommandBase.cxx25
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
-rw-r--r--Source/cmcmd.cxx12
22 files changed, 113 insertions, 101 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 5e2758a..ded21bc 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -892,7 +892,7 @@ set(CPACK_SRCS
CPack/cmCPackArchiveGenerator.cxx
CPack/cmCPackComponentGroup.cxx
CPack/cmCPackDebGenerator.cxx
- CPack/cmCPackExtGenerator.cxx
+ CPack/cmCPackExternalGenerator.cxx
CPack/cmCPackGeneratorFactory.cxx
CPack/cmCPackGenerator.cxx
CPack/cmCPackLog.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4481ea4..7918d80 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 20181031)
+set(CMake_VERSION_PATCH 20181106)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackExtGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 4c560b9..9f7b236 100644
--- a/Source/CPack/cmCPackExtGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -1,6 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmCPackExtGenerator.h"
+#include "cmCPackExternalGenerator.h"
#include "cmAlgorithms.h"
#include "cmCPackComponentGroup.h"
@@ -16,25 +16,25 @@
#include <utility>
#include <vector>
-int cmCPackExtGenerator::InitializeInternal()
+int cmCPackExternalGenerator::InitializeInternal()
{
- this->SetOption("CPACK_EXT_KNOWN_VERSIONS", "1.0");
+ this->SetOption("CPACK_EXTERNAL_KNOWN_VERSIONS", "1.0");
- if (!this->ReadListFile("Internal/CPack/CPackExt.cmake")) {
+ if (!this->ReadListFile("Internal/CPack/CPackExternal.cmake")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Error while executing CPackExt.cmake" << std::endl);
+ "Error while executing CPackExternal.cmake" << std::endl);
return 0;
}
- std::string major = this->GetOption("CPACK_EXT_SELECTED_MAJOR");
+ std::string major = this->GetOption("CPACK_EXTERNAL_SELECTED_MAJOR");
if (major == "1") {
- this->Generator = cm::make_unique<cmCPackExtVersion1Generator>(this);
+ this->Generator = cm::make_unique<cmCPackExternalVersion1Generator>(this);
}
return this->Superclass::InitializeInternal();
}
-int cmCPackExtGenerator::PackageFiles()
+int cmCPackExternalGenerator::PackageFiles()
{
Json::StreamWriterBuilder builder;
builder["indentation"] = " ";
@@ -57,12 +57,12 @@ int cmCPackExtGenerator::PackageFiles()
return 0;
}
- const char* packageScript = this->GetOption("CPACK_EXT_PACKAGE_SCRIPT");
+ const char* packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT");
if (packageScript && *packageScript) {
if (!cmSystemTools::FileIsFullPath(packageScript)) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
- "CPACK_EXT_PACKAGE_SCRIPT does not contain a full file path"
+ "CPACK_EXTERNAL_PACKAGE_SCRIPT does not contain a full file path"
<< std::endl);
return 0;
}
@@ -77,12 +77,12 @@ int cmCPackExtGenerator::PackageFiles()
return 1;
}
-bool cmCPackExtGenerator::SupportsComponentInstallation() const
+bool cmCPackExternalGenerator::SupportsComponentInstallation() const
{
return true;
}
-int cmCPackExtGenerator::InstallProjectViaInstallCommands(
+int cmCPackExternalGenerator::InstallProjectViaInstallCommands(
bool setDestDir, const std::string& tempInstallDirectory)
{
if (this->StagingEnabled()) {
@@ -93,7 +93,7 @@ int cmCPackExtGenerator::InstallProjectViaInstallCommands(
return 1;
}
-int cmCPackExtGenerator::InstallProjectViaInstallScript(
+int cmCPackExternalGenerator::InstallProjectViaInstallScript(
bool setDestDir, const std::string& tempInstallDirectory)
{
if (this->StagingEnabled()) {
@@ -104,7 +104,7 @@ int cmCPackExtGenerator::InstallProjectViaInstallScript(
return 1;
}
-int cmCPackExtGenerator::InstallProjectViaInstalledDirectories(
+int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories(
bool setDestDir, const std::string& tempInstallDirectory,
const mode_t* default_dir_mode)
{
@@ -116,7 +116,7 @@ int cmCPackExtGenerator::InstallProjectViaInstalledDirectories(
return 1;
}
-int cmCPackExtGenerator::RunPreinstallTarget(
+int cmCPackExternalGenerator::RunPreinstallTarget(
const std::string& installProjectName, const std::string& installDirectory,
cmGlobalGenerator* globalGenerator, const std::string& buildConfig)
{
@@ -128,7 +128,7 @@ int cmCPackExtGenerator::RunPreinstallTarget(
return 1;
}
-int cmCPackExtGenerator::InstallCMakeProject(
+int cmCPackExternalGenerator::InstallCMakeProject(
bool setDestDir, const std::string& installDirectory,
const std::string& baseTempInstallDirectory, const mode_t* default_dir_mode,
const std::string& component, bool componentInstall,
@@ -145,18 +145,19 @@ int cmCPackExtGenerator::InstallCMakeProject(
return 1;
}
-bool cmCPackExtGenerator::StagingEnabled() const
+bool cmCPackExternalGenerator::StagingEnabled() const
{
- return !cmSystemTools::IsOff(this->GetOption("CPACK_EXT_ENABLE_STAGING"));
+ return !cmSystemTools::IsOff(
+ this->GetOption("CPACK_EXTERNAL_ENABLE_STAGING"));
}
-cmCPackExtGenerator::cmCPackExtVersionGenerator::cmCPackExtVersionGenerator(
- cmCPackExtGenerator* parent)
+cmCPackExternalGenerator::cmCPackExternalVersionGenerator::
+ cmCPackExternalVersionGenerator(cmCPackExternalGenerator* parent)
: Parent(parent)
{
}
-int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteVersion(
+int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteVersion(
Json::Value& root)
{
root["formatVersionMajor"] = this->GetVersionMajor();
@@ -165,7 +166,7 @@ int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteVersion(
return 1;
}
-int cmCPackExtGenerator::cmCPackExtVersionGenerator::WriteToJSON(
+int cmCPackExternalGenerator::cmCPackExternalVersionGenerator::WriteToJSON(
Json::Value& root)
{
if (!this->WriteVersion(root)) {
diff --git a/Source/CPack/cmCPackExtGenerator.h b/Source/CPack/cmCPackExternalGenerator.h
index 103e56d..176d6a9 100644
--- a/Source/CPack/cmCPackExtGenerator.h
+++ b/Source/CPack/cmCPackExternalGenerator.h
@@ -1,7 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmCPackExtGenerator_h
-#define cmCPackExtGenerator_h
+#ifndef cmCPackExternalGenerator_h
+#define cmCPackExternalGenerator_h
#include "cmCPackGenerator.h"
#include "cm_sys_stat.h"
@@ -14,13 +14,13 @@ namespace Json {
class Value;
}
-/** \class cmCPackExtGenerator
+/** \class cmCPackExternalGenerator
* \brief A generator for CPack External packaging tools
*/
-class cmCPackExtGenerator : public cmCPackGenerator
+class cmCPackExternalGenerator : public cmCPackGenerator
{
public:
- cmCPackTypeMacro(cmCPackExtGenerator, cmCPackGenerator);
+ cmCPackTypeMacro(cmCPackExternalGenerator, cmCPackGenerator);
const char* GetOutputExtension() override { return ".json"; }
@@ -54,12 +54,12 @@ protected:
private:
bool StagingEnabled() const;
- class cmCPackExtVersionGenerator
+ class cmCPackExternalVersionGenerator
{
public:
- cmCPackExtVersionGenerator(cmCPackExtGenerator* parent);
+ cmCPackExternalVersionGenerator(cmCPackExternalGenerator* parent);
- virtual ~cmCPackExtVersionGenerator() = default;
+ virtual ~cmCPackExternalVersionGenerator() = default;
virtual int WriteToJSON(Json::Value& root);
@@ -69,20 +69,21 @@ private:
int WriteVersion(Json::Value& root);
- cmCPackExtGenerator* Parent;
+ cmCPackExternalGenerator* Parent;
};
- class cmCPackExtVersion1Generator : public cmCPackExtVersionGenerator
+ class cmCPackExternalVersion1Generator
+ : public cmCPackExternalVersionGenerator
{
public:
- using cmCPackExtVersionGenerator::cmCPackExtVersionGenerator;
+ using cmCPackExternalVersionGenerator::cmCPackExternalVersionGenerator;
protected:
int GetVersionMajor() override { return 1; }
int GetVersionMinor() override { return 0; }
};
- std::unique_ptr<cmCPackExtVersionGenerator> Generator;
+ std::unique_ptr<cmCPackExternalVersionGenerator> Generator;
};
#endif
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index 8ef24f7..2c5ab4d 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
+++ b/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -12,7 +12,7 @@
# include "cmCPackFreeBSDGenerator.h"
#endif
#include "cmCPackDebGenerator.h"
-#include "cmCPackExtGenerator.h"
+#include "cmCPackExternalGenerator.h"
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmCPackNSISGenerator.h"
@@ -111,9 +111,9 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory()
this->RegisterGenerator("NuGet", "NuGet packages",
cmCPackNuGetGenerator::CreateGenerator);
}
- if (cmCPackExtGenerator::CanGenerate()) {
- this->RegisterGenerator("Ext", "CPack External packages",
- cmCPackExtGenerator::CreateGenerator);
+ if (cmCPackExternalGenerator::CanGenerate()) {
+ this->RegisterGenerator("External", "CPack External packages",
+ cmCPackExternalGenerator::CreateGenerator);
}
#ifdef __APPLE__
if (cmCPackDragNDropGenerator::CanGenerate()) {
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 91ccdf7..53f5593 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -318,12 +318,6 @@ bool cmAddCustomCommandCommand::InitialPass(
return false;
}
- // Convert working directory to a full path.
- if (!working.empty()) {
- const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory();
- working = cmSystemTools::CollapseFullPath(working, build_dir);
- }
-
// Choose which mode of the command to use.
bool escapeOldStyle = !verbatim;
if (source.empty() && output.empty()) {
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 82ee6b4..ddd9b70 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -181,13 +181,6 @@ bool cmAddCustomTargetCommand::InitialPass(
}
}
- // Convert working directory to a full path.
- if (!working_directory.empty()) {
- const std::string& build_dir = this->Makefile->GetCurrentBinaryDirectory();
- working_directory =
- cmSystemTools::CollapseFullPath(working_directory, build_dir);
- }
-
if (commandLines.empty() && !byproducts.empty()) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 5bbae17..d1c1736 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -70,6 +70,12 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
std::unique_ptr<cmCompiledGeneratorExpression> cge =
this->GE->Parse(workingdirectory);
this->WorkingDirectory = cge->Evaluate(this->LG, this->Config);
+ // Convert working directory to a full path.
+ if (!this->WorkingDirectory.empty()) {
+ std::string const& build_dir = this->LG->GetCurrentBinaryDirectory();
+ this->WorkingDirectory =
+ cmSystemTools::CollapseFullPath(this->WorkingDirectory, build_dir);
+ }
}
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 4cf9dd7..bddc3c4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -855,7 +855,7 @@ void cmExportFileGenerator::SetImportDetailProperties(
std::string propval;
if (auto* p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
propval = p;
- } else if (target->HasLanguage("CSharp", config)) {
+ } else if (target->IsCSharpOnly()) {
// C# projects do not have the /clr flag, so we set the property
// here to mark the target as (only) managed (i.e. no .lib file
// to link to). Otherwise the COMMON_LANGUAGE_RUNTIME target
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index 04a3c0e..b36ac78 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -315,6 +315,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
for (std::string const& p : paths) {
std::vector<std::string> pathSegments;
cmsys::SystemTools::SplitPath(p, pathSegments, true);
+ const bool pathIsFile = !cmsys::SystemTools::FileIsDirectory(p);
const size_t segmentCount = pathSegments.size();
if (segmentCount < 2) { // Expect at least rootdir and filename
@@ -324,7 +325,7 @@ void cmFileMonitor::MonitorPaths(const std::vector<std::string>& paths,
for (size_t i = 0; i < segmentCount; ++i) {
assert(currentWatcher);
- const bool fileSegment = (i == segmentCount - 1);
+ const bool fileSegment = (i == segmentCount - 1 && pathIsFile);
const bool rootSegment = (i == 0);
assert(
!(fileSegment &&
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b8c9598..71947ea 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5716,20 +5716,23 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages,
}
}
-bool cmGeneratorTarget::HasLanguage(std::string const& language,
- std::string const& config,
- bool exclusive) const
+bool cmGeneratorTarget::IsCSharpOnly() const
{
- std::set<std::string> languages;
- this->GetLanguages(languages, config);
- // The "exclusive" check applies only to source files and not
- // the linker language which may be affected by dependencies.
- if (exclusive && languages.size() > 1) {
+ // Only certain target types may compile CSharp.
+ if (this->GetType() != cmStateEnums::SHARED_LIBRARY &&
+ this->GetType() != cmStateEnums::STATIC_LIBRARY &&
+ this->GetType() != cmStateEnums::EXECUTABLE) {
return false;
}
- // add linker language (if it is different from compiler languages)
- languages.insert(this->GetLinkerLanguage(config));
- return languages.count(language) > 0;
+ std::set<std::string> languages;
+ this->GetLanguages(languages, "");
+ // Consider an explicit linker language property, but *not* the
+ // computed linker language that may depend on linked targets.
+ const char* linkLang = this->GetProperty("LINKER_LANGUAGE");
+ if (linkLang && *linkLang) {
+ languages.insert(linkLang);
+ }
+ return languages.size() == 1 && languages.count("CSharp") > 0;
}
void cmGeneratorTarget::ComputeLinkImplementationLanguages(
@@ -6095,6 +6098,5 @@ cmGeneratorTarget::ManagedType cmGeneratorTarget::GetManagedType(
// C# targets are always managed. This language specific check
// is added to avoid that the COMMON_LANGUAGE_RUNTIME target property
// has to be set manually for C# targets.
- return this->HasLanguage("CSharp", config) ? ManagedType::Managed
- : ManagedType::Native;
+ return this->IsCSharpOnly() ? ManagedType::Managed : ManagedType::Native;
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 4c32558..5e7cf12 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -372,11 +372,7 @@ public:
void GetLanguages(std::set<std::string>& languages,
std::string const& config) const;
- // Evaluate if the target uses the given language for compilation
- // and/or linking. If 'exclusive' is true, 'language' is expected
- // to be the only language used in source files for the target.
- bool HasLanguage(std::string const& language, std::string const& config,
- bool exclusive = true) const;
+ bool IsCSharpOnly() const;
void GetObjectLibrariesCMP0026(
std::vector<cmGeneratorTarget*>& objlibs) const;
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index a216346..3be09b0 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -98,7 +98,7 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
ext = ".vfproj";
project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
}
- if (t->HasLanguage("CSharp", "")) {
+ if (t->IsCSharpOnly()) {
ext = ".csproj";
project = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"";
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index d5a18e6..a065408 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -65,6 +65,7 @@ static const char* ruleReplaceVars[] = {
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
"CMAKE_LINKER",
+ "CMAKE_MT",
"CMAKE_CUDA_HOST_COMPILER",
"CMAKE_CUDA_HOST_LINK_LAUNCHER",
"CMAKE_CL_SHOWINCLUDES_PREFIX"
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index eb31478..66edc91 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmGlobalNinjaGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmNinjaTargetGenerator.h"
#include "cmRulePlaceholderExpander.h"
@@ -40,8 +41,7 @@ cmRulePlaceholderExpander*
cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const
{
cmRulePlaceholderExpander* ret =
- new cmRulePlaceholderExpander(this->Compilers, this->VariableMappings,
- this->CompilerSysroot, this->LinkerSysroot);
+ this->cmLocalGenerator::CreateRulePlaceholderExpander();
ret->SetTargetImpLib("$TARGET_IMPLIB");
return ret;
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 6436969..1386706 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -506,7 +506,6 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
/*realname=*/true));
cmakeCommand += targetOutputReal;
- cmakeCommand += " || true";
linkCmds.push_back(std::move(cmakeCommand));
}
return linkCmds;
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 7700767..a213c84 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -322,6 +322,9 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
// Autogen target: Compute user defined dependencies
{
+ this->AutogenTarget.DependOrigin =
+ this->Target->GetPropertyAsBool("AUTOGEN_ORIGIN_DEPENDS");
+
std::string const deps =
this->Target->GetSafeProperty("AUTOGEN_TARGET_DEPENDS");
if (!deps.empty()) {
@@ -904,7 +907,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Add link library target dependencies to the autogen target
// dependencies
- {
+ if (this->AutogenTarget.DependOrigin) {
// add_dependencies/addUtility do not support generator expressions.
// We depend only on the libraries found in all configs therefore.
std::map<cmGeneratorTarget const*, std::size_t> commonTargets;
@@ -941,8 +944,10 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
new cmGeneratorTarget(autogenTarget, localGen));
// Forward origin utilities to autogen target
- for (BT<std::string> const& depName : this->Target->GetUtilities()) {
- autogenTarget->AddUtility(depName.Value, makefile);
+ if (this->AutogenTarget.DependOrigin) {
+ for (BT<std::string> const& depName : this->Target->GetUtilities()) {
+ autogenTarget->AddUtility(depName.Value, makefile);
+ }
}
// Add additional autogen target dependencies to autogen target
for (cmTarget* depTarget : this->AutogenTarget.DependTargets) {
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index ce00e00..1d3947b 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -107,6 +107,7 @@ private:
std::string SettingsFile;
std::map<std::string, std::string> ConfigSettingsFile;
// Dependencies
+ bool DependOrigin = false;
std::set<std::string> DependFiles;
std::set<cmTarget*> DependTargets;
// Sources to process
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 987bdb3..5d76a02 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -239,6 +239,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("AUTOMOC", nullptr);
this->SetPropertyDefault("AUTOUIC", nullptr);
this->SetPropertyDefault("AUTORCC", nullptr);
+ this->SetPropertyDefault("AUTOGEN_ORIGIN_DEPENDS", nullptr);
this->SetPropertyDefault("AUTOGEN_PARALLEL", nullptr);
this->SetPropertyDefault("AUTOMOC_COMPILER_PREDEFINES", nullptr);
this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr);
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 9a8fd96..1b8ee81 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -84,15 +84,6 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
this->SetError("called with invalid arguments");
return false;
}
- if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
- scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on INTERFACE targets");
- return false;
- }
- if (this->Target->IsImported() && scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on IMPORTED targets");
- return false;
- }
++argIndex;
@@ -101,10 +92,21 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
for (unsigned int i = argIndex; i < args.size(); ++i, ++argIndex) {
if (args[i] == "PUBLIC" || args[i] == "PRIVATE" ||
args[i] == "INTERFACE") {
- return this->PopulateTargetProperies(scope, content, prepend, system);
+ break;
}
content.push_back(args[i]);
}
+ if (!content.empty()) {
+ if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
+ scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on INTERFACE targets");
+ return false;
+ }
+ if (this->Target->IsImported() && scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on IMPORTED targets");
+ return false;
+ }
+ }
return this->PopulateTargetProperies(scope, content, prepend, system);
}
@@ -112,6 +114,9 @@ bool cmTargetPropCommandBase::PopulateTargetProperies(
const std::string& scope, const std::vector<std::string>& content,
bool prepend, bool system)
{
+ if (content.empty()) {
+ return true;
+ }
if (scope == "PRIVATE" || scope == "PUBLIC") {
if (!this->HandleDirectContent(this->Target, content, prepend, system)) {
return false;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index eb1a27e..e9a1a67 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -205,12 +205,11 @@ static bool cmVS10IsTargetsFile(std::string const& path)
return cmSystemTools::Strucmp(ext.c_str(), ".targets") == 0;
}
-static std::string computeProjectFileExtension(cmGeneratorTarget const* t,
- const std::string& config)
+static std::string computeProjectFileExtension(cmGeneratorTarget const* t)
{
std::string res;
res = ".vcxproj";
- if (t->HasLanguage("CSharp", config)) {
+ if (t->IsCSharpOnly()) {
res = ".csproj";
}
return res;
@@ -305,8 +304,8 @@ void cmVisualStudio10TargetGenerator::Generate()
this->GeneratorTarget->GetProperty("EXTERNAL_MSPROJECT")) {
return;
}
- const std::string ProjectFileExtension = computeProjectFileExtension(
- this->GeneratorTarget, *this->Configurations.begin());
+ const std::string ProjectFileExtension =
+ computeProjectFileExtension(this->GeneratorTarget);
if (ProjectFileExtension == ".vcxproj") {
this->ProjectType = vcxproj;
this->Managed = false;
@@ -1398,8 +1397,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
std::string path = this->LocalGenerator->GetCurrentBinaryDirectory();
path += "/";
path += this->Name;
- path += computeProjectFileExtension(this->GeneratorTarget,
- *this->Configurations.begin());
+ path += computeProjectFileExtension(this->GeneratorTarget);
path += ".filters";
cmGeneratedFileStream fout(path);
fout.SetCopyIfDifferent(true);
@@ -3800,7 +3798,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
path = lg->GetCurrentBinaryDirectory();
path += "/";
path += dt->GetName();
- path += computeProjectFileExtension(dt, *this->Configurations.begin());
+ path += computeProjectFileExtension(dt);
}
ConvertToWindowsSlash(path);
Elem e2(e1, "ProjectReference");
@@ -3826,7 +3824,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
}
// Workaround for static library C# targets
if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
- referenceNotManaged = !dt->HasLanguage("CSharp", "");
+ referenceNotManaged = !dt->IsCSharpOnly();
}
if (referenceNotManaged) {
e2.Element("ReferenceOutputAssembly", "false");
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index e2225ff..8a140e8 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1521,6 +1521,8 @@ class cmVSLink
std::string ManifestFileRC;
std::string ManifestFileRes;
std::string TargetFile;
+ std::string MtPath;
+ std::string RcPath;
public:
cmVSLink(int type, bool verbose)
@@ -1664,6 +1666,12 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
} else if (cmHasLiteralPrefix(*arg, "--intdir=")) {
intDir = arg->substr(9);
++arg;
+ } else if (cmHasLiteralPrefix(*arg, "--rc=")) {
+ this->RcPath = arg->substr(5);
+ ++arg;
+ } else if (cmHasLiteralPrefix(*arg, "--mt=")) {
+ this->MtPath = arg->substr(5);
+ ++arg;
} else {
std::cerr << "unknown argument '" << *arg << "'\n";
return false;
@@ -1803,7 +1811,7 @@ int cmVSLink::LinkIncremental()
// Compile the resource file.
std::vector<std::string> rcCommand;
- rcCommand.push_back("rc");
+ rcCommand.push_back(this->RcPath.empty() ? "rc" : this->RcPath);
rcCommand.push_back("/fo" + this->ManifestFileRes);
rcCommand.push_back(this->ManifestFileRC);
if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
@@ -1862,7 +1870,7 @@ int cmVSLink::LinkNonIncremental()
int cmVSLink::RunMT(std::string const& out, bool notify)
{
std::vector<std::string> mtCommand;
- mtCommand.push_back("mt");
+ mtCommand.push_back(this->MtPath.empty() ? "mt" : this->MtPath);
mtCommand.push_back("/nologo");
mtCommand.push_back("/manifest");
if (this->LinkGeneratesManifest) {