diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-11 17:39:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-02-12 16:19:27 (GMT) |
commit | f2eee72facb9b4a658e1205bbe9113a808e76775 (patch) | |
tree | b9ee09e297649dffb9dc656936a263f1384703c2 /Source/cmAddCustomCommandCommand.cxx | |
parent | c248a437c47b4419fd955d4b1f406f7c8b9dcd74 (diff) | |
download | CMake-f2eee72facb9b4a658e1205bbe9113a808e76775.zip CMake-f2eee72facb9b4a658e1205bbe9113a808e76775.tar.gz CMake-f2eee72facb9b4a658e1205bbe9113a808e76775.tar.bz2 |
add_custom_command: Disallow use of SOURCE signatures.
Add CMP0050 to control this behavior.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 5634849..3de04f5 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -344,6 +344,36 @@ bool cmAddCustomCommandCommand } else { + bool issueMessage = true; + cmOStringStream e; + cmake::MessageType messageType = cmake::AUTHOR_WARNING; + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) + { + case cmPolicies::WARN: + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0050)) << "\n"; + break; + case cmPolicies::OLD: + issueMessage = false; + break; + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::NEW: + messageType = cmake::FATAL_ERROR; + break; + } + + if (issueMessage) + { + e << "The SOURCE signatures of add_custom_command are no longer " + "supported."; + this->Makefile->IssueMessage(messageType, e.str().c_str()); + if (messageType == cmake::FATAL_ERROR) + { + return false; + } + } + // Use the old-style mode for backward compatibility. this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends, source.c_str(), commandLines, |