diff options
author | Brad King <brad.king@kitware.com> | 2008-02-11 18:35:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-11 18:35:39 (GMT) |
commit | ac0e58dcfbf17dec84b7bd848f6df0175f7d516b (patch) | |
tree | fd1cbb7b8fb4d6cec4fa467ea1e174b2b8535146 /Source/cmAddCustomTargetCommand.cxx | |
parent | 739a463539946323b09e4c22f5fdd38395add1e1 (diff) | |
download | CMake-ac0e58dcfbf17dec84b7bd848f6df0175f7d516b.zip CMake-ac0e58dcfbf17dec84b7bd848f6df0175f7d516b.tar.gz CMake-ac0e58dcfbf17dec84b7bd848f6df0175f7d516b.tar.bz2 |
ENH: Enforce global target name uniqueness.
- Error if imported target is involved in conflict
- Error for non-imported target conflict unless
CMAKE_BACKWARDS_COMPATIBILITY <= 2.4
- Include OUTPUT_NAME property in error message
- Update add_executable and add_library command documentation
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index dfb9b0c..085a80d 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -158,6 +158,14 @@ bool cmAddCustomTargetCommand currentLine.clear(); } + // Enforce name uniqueness. + std::string msg; + if(!this->Makefile->EnforceUniqueName(args[0], msg)) + { + this->SetError(msg.c_str()); + return false; + } + // Add the utility target to the makefile. bool escapeOldStyle = !verbatim; this->Makefile->AddUtilityCommand(args[0].c_str(), excludeFromAll, |