diff options
author | Brad King <brad.king@kitware.com> | 2008-02-14 16:58:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-14 16:58:32 (GMT) |
commit | 5b02a4a864d2e68c683be6275709ce3e38d51fee (patch) | |
tree | 70b57c336d56db5afe08acfb7ab0ed4aa84c5b1b /Source/cmMakefile.cxx | |
parent | 8375bb4768f29f595c66140b77dd6b01713afb79 (diff) | |
download | CMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.zip CMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.tar.gz CMake-5b02a4a864d2e68c683be6275709ce3e38d51fee.tar.bz2 |
ENH: Re-enable diagnosis of non-unique target names.
- Re-enable enforcement in cmMakefile::EnforceUniqueName
- Improve error message to help user resolve the problem
- Fix Modules/CTestTargets.cmake to not duplicate testing targets
- Move commands used by the changes to Modules/CTestTargets.cmake
to build during bootstrap: DEFINE_PROPERTY, GET_PROPERTY
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 5834d53..35b0aea 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3156,7 +3156,6 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg) msg = e.str(); return false; } -#if 0 /* disable until CTestTargets can be fixed */ else if(!this->NeedBackwardsCompatibility(2, 4)) { // The conflict is with a non-imported target. Produce an error @@ -3165,9 +3164,10 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg) e << "cannot create target \"" << name << "\" because another target with the same name already exists. " << "Logical target names must be globally unique. " - << "Consider using the OUTPUT_NAME target property to create " - << "two targets with the same physical name while keeping logical " - << "names distinct.\n" + << "For executables and libraries, consider using the OUTPUT_NAME " + << "target property to create two targets with the same physical " + << "name while keeping logical names distinct. " + << "Custom targets must simply have globally unique names.\n" << "If you are building an older project it is possible that " << "it violated this rule but was working accidentally. " << "Set CMAKE_BACKWARDS_COMPATIBILITY to 2.4 or lower to disable " @@ -3175,7 +3175,6 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg) msg = e.str(); return false; } -#endif } return true; } |