summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-29 12:52:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-29 12:52:44 (GMT)
commit460a94e29f19846bc219f8f8a02cddb196472be9 (patch)
tree60048ba2f9765c2ea1f4704d43437f7937712073 /Source
parente6e32101d8e9c34a6ec2f5e8c9051d2f8bfdece2 (diff)
parentff6a51254a77ece4ec741c8cf061c01fcfe0f62d (diff)
downloadCMake-460a94e29f19846bc219f8f8a02cddb196472be9.zip
CMake-460a94e29f19846bc219f8f8a02cddb196472be9.tar.gz
CMake-460a94e29f19846bc219f8f8a02cddb196472be9.tar.bz2
Merge topic 'autogen-cmp0071-warning'
ff6a5125 Autogen: Doc: Add examples to the SKIP_AUTO* documentations 8831818f Autogen: Doc: Update CMP0071 description b0775c75 Autogen: Offer solution for CMP0071 in warning message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1322
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx65
1 files changed, 37 insertions, 28 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 9befd65..1ce350f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -662,23 +662,24 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
{
std::vector<std::string> toolNames;
if (digest.MocEnabled) {
- toolNames.push_back("MOC");
+ toolNames.emplace_back("MOC");
}
if (digest.UicEnabled) {
- toolNames.push_back("UIC");
+ toolNames.emplace_back("UIC");
}
if (digest.RccEnabled) {
- toolNames.push_back("RCC");
+ toolNames.emplace_back("RCC");
}
- std::string tools = toolNames[0];
+ std::string tools = toolNames.front();
toolNames.erase(toolNames.begin());
- while (toolNames.size() > 1) {
- tools += ", " + toolNames[0];
- toolNames.erase(toolNames.begin());
- }
- if (toolNames.size() == 1) {
- tools += " and " + toolNames[0];
+ if (!toolNames.empty()) {
+ while (toolNames.size() > 1) {
+ tools += ", ";
+ tools += toolNames.front();
+ toolNames.erase(toolNames.begin());
+ }
+ tools += " and " + toolNames.front();
}
autogenComment = "Automatic " + tools + " for target " + target->GetName();
}
@@ -809,27 +810,35 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
msg += cmPolicies::GetPolicyWarning(cmPolicies::CMP0071);
msg += "\n";
std::string tools;
- if (digest.MocEnabled) {
- tools += "AUTOMOC";
- }
- if (digest.UicEnabled) {
- if (!tools.empty()) {
- tools += ",";
- }
- tools += "AUTOUIC";
+ std::string property;
+ if (digest.MocEnabled && digest.UicEnabled) {
+ tools = "AUTOMOC and AUTOUIC";
+ property = "SKIP_AUTOGEN";
+ } else if (digest.MocEnabled) {
+ tools = "AUTOMOC";
+ property = "SKIP_AUTOMOC";
+ } else if (digest.UicEnabled) {
+ tools = "AUTOUIC";
+ property = "SKIP_AUTOUIC";
}
- if (!generatedHeaders.empty()) {
- msg.append(tools).append(": Ignoring GENERATED header file(s):\n");
- for (std::string const& absFile : generatedHeaders) {
- msg.append(" ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
- }
+ msg += "For compatibility, CMake is excluding the GENERATED source "
+ "file(s):\n";
+ for (const std::string& absFile : generatedHeaders) {
+ msg.append(" ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
}
- if (!generatedSources.empty()) {
- msg.append(tools).append(": Ignoring GENERATED source file(s):\n");
- for (std::string const& absFile : generatedSources) {
- msg.append(" ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
- }
+ for (const std::string& absFile : generatedSources) {
+ msg.append(" ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
}
+ msg += "from processing by ";
+ msg += tools;
+ msg +=
+ ". If any of the files should be processed, set CMP0071 to NEW. "
+ "If any of the files should not be processed, "
+ "explicitly exclude them by setting the source file property ";
+ msg += property;
+ msg += ":\n set_property(SOURCE file.h PROPERTY ";
+ msg += property;
+ msg += " ON)\n";
makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
}
}