summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-14 16:58:32 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-14 16:58:32 (GMT)
commit5b02a4a864d2e68c683be6275709ce3e38d51fee (patch)
tree70b57c336d56db5afe08acfb7ab0ed4aa84c5b1b /Source
parent8375bb4768f29f595c66140b77dd6b01713afb79 (diff)
downloadCMake-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')
-rw-r--r--Source/cmBootstrapCommands.cxx4
-rw-r--r--Source/cmCommands.cxx4
-rw-r--r--Source/cmMakefile.cxx9
3 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx
index 197ee2b..af9bf3d 100644
--- a/Source/cmBootstrapCommands.cxx
+++ b/Source/cmBootstrapCommands.cxx
@@ -34,6 +34,7 @@
#include "cmConfigureFileCommand.cxx"
#include "cmCoreTryCompile.cxx"
#include "cmCreateTestSourceList.cxx"
+#include "cmDefinePropertyCommand.cxx"
#include "cmElseCommand.cxx"
#include "cmEnableTestingCommand.cxx"
#include "cmEndForEachCommand.cxx"
@@ -56,6 +57,7 @@
#include "cmGetCMakePropertyCommand.cxx"
#include "cmGetDirectoryPropertyCommand.cxx"
#include "cmGetFilenameComponentCommand.cxx"
+#include "cmGetPropertyCommand.cxx"
#include "cmGetSourceFilePropertyCommand.cxx"
#include "cmGetTargetPropertyCommand.cxx"
#include "cmHexFileConverter.cxx"
@@ -103,6 +105,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmCMakeMinimumRequired);
commands.push_back(new cmConfigureFileCommand);
commands.push_back(new cmCreateTestSourceList);
+ commands.push_back(new cmDefinePropertyCommand);
commands.push_back(new cmElseCommand);
commands.push_back(new cmEnableTestingCommand);
commands.push_back(new cmEndForEachCommand);
@@ -122,6 +125,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmGetCMakePropertyCommand);
commands.push_back(new cmGetDirectoryPropertyCommand);
commands.push_back(new cmGetFilenameComponentCommand);
+ commands.push_back(new cmGetPropertyCommand);
commands.push_back(new cmGetSourceFilePropertyCommand);
commands.push_back(new cmGetTargetPropertyCommand);
commands.push_back(new cmIfCommand);
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index ff733eb..42ec776 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -18,14 +18,12 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmAuxSourceDirectoryCommand.cxx"
#include "cmBuildNameCommand.cxx"
-#include "cmDefinePropertyCommand.cxx"
#include "cmElseIfCommand.cxx"
#include "cmEnableLanguageCommand.cxx"
#include "cmEndWhileCommand.cxx"
#include "cmExportCommand.cxx"
#include "cmExportLibraryDependencies.cxx"
#include "cmFLTKWrapUICommand.cxx"
-#include "cmGetPropertyCommand.cxx"
#include "cmGetTestPropertyCommand.cxx"
#include "cmIncludeExternalMSProjectCommand.cxx"
#include "cmInstallCommand.cxx"
@@ -64,14 +62,12 @@ void GetPredefinedCommands(std::list<cmCommand*>&
#if defined(CMAKE_BUILD_WITH_CMAKE)
commands.push_back(new cmAuxSourceDirectoryCommand);
commands.push_back(new cmBuildNameCommand);
- commands.push_back(new cmDefinePropertyCommand);
commands.push_back(new cmElseIfCommand);
commands.push_back(new cmEnableLanguageCommand);
commands.push_back(new cmEndWhileCommand);
commands.push_back(new cmExportCommand);
commands.push_back(new cmExportLibraryDependenciesCommand);
commands.push_back(new cmFLTKWrapUICommand);
- commands.push_back(new cmGetPropertyCommand);
commands.push_back(new cmGetTestPropertyCommand);
commands.push_back(new cmIncludeExternalMSProjectCommand);
commands.push_back(new cmInstallCommand);
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;
}