summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-23 20:11:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-23 20:11:40 (GMT)
commit76ace2b95aba4b12c049224aa8a2d18c67129d45 (patch)
treeccd724658e75bc976fb0ae88b70e3078f8e57aa6 /Source
parent7db963a01789f50f6c3bf111a63dcab09b9a88cd (diff)
parentb98d14d40016efee420bee26b9795880fdf6a5f8 (diff)
downloadCMake-76ace2b95aba4b12c049224aa8a2d18c67129d45.zip
CMake-76ace2b95aba4b12c049224aa8a2d18c67129d45.tar.gz
CMake-76ace2b95aba4b12c049224aa8a2d18c67129d45.tar.bz2
Merge topic 'disallow-IMPORTED-interface-porcelain'
b98d14d Disallow porcelain to populate includes and defines of IMPORTED targets. 48a4cf2 Revert "Allow target_link_libraries with IMPORTED targets."
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx8
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.h5
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx8
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.h5
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx14
-rw-r--r--Source/cmTargetPropCommandBase.cxx4
-rw-r--r--Source/cmTargetPropCommandBase.h3
7 files changed, 13 insertions, 34 deletions
diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx
index 492a1b7..683eff6 100644
--- a/Source/cmTargetCompileDefinitionsCommand.cxx
+++ b/Source/cmTargetCompileDefinitionsCommand.cxx
@@ -20,13 +20,11 @@ bool cmTargetCompileDefinitionsCommand
}
void cmTargetCompileDefinitionsCommand
-::HandleImportedTargetInvalidScope(const std::string &scope,
- const std::string &tgt)
+::HandleImportedTarget(const std::string &tgt)
{
cmOStringStream e;
- e << "Cannot specify " << scope << " compile definitions for imported "
- "target \"" << tgt << "\". Compile definitions can only be "
- "specified for an imported target in the INTERFACE mode.";
+ e << "Cannot specify compile definitions for imported target \""
+ << tgt << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index 4b066b7a..d49b9e8 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -59,7 +59,7 @@ public:
"Specify compile definitions or targets to use when compiling a given "
"target. "
"The named <target> must have been created by a command such as "
- "add_executable or add_library. "
+ "add_executable or add_library and must not be an IMPORTED target. "
"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
"the scope of the following arguments. PRIVATE and PUBLIC items will "
"populate the COMPILE_DEFINITIONS property of <target>. PUBLIC and "
@@ -78,8 +78,7 @@ public:
cmTypeMacro(cmTargetCompileDefinitionsCommand, cmCommand);
private:
- virtual void HandleImportedTargetInvalidScope(const std::string &scope,
- const std::string &tgt);
+ virtual void HandleImportedTarget(const std::string &tgt);
virtual void HandleMissingTarget(const std::string &name);
virtual bool HandleNonTargetArg(std::string &content,
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index 18e2cba..aeba468 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -22,13 +22,11 @@ bool cmTargetIncludeDirectoriesCommand
//----------------------------------------------------------------------------
void cmTargetIncludeDirectoriesCommand
-::HandleImportedTargetInvalidScope(const std::string &tgt,
- const std::string &scope)
+::HandleImportedTarget(const std::string &tgt)
{
cmOStringStream e;
- e << "Cannot specify " << scope << " include directories for imported "
- "target \"" << tgt << "\". Include directories can only be "
- "specified for an imported target in the INTERFACE mode.";
+ e << "Cannot specify include directories for imported target \""
+ << tgt << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 90e039c..5a5f859 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -60,7 +60,7 @@ public:
"Specify include directories or targets to use when compiling a given "
"target. "
"The named <target> must have been created by a command such as "
- "add_executable or add_library.\n"
+ "add_executable or add_library and must not be an IMPORTED target.\n"
"If BEFORE is specified, the content will be prepended to the property "
"instead of being appended.\n"
"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
@@ -82,8 +82,7 @@ public:
cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmCommand);
private:
- virtual void HandleImportedTargetInvalidScope(const std::string &tgt,
- const std::string &scope);
+ virtual void HandleImportedTarget(const std::string &tgt);
virtual void HandleMissingTarget(const std::string &name);
virtual bool HandleNonTargetArg(std::string &content,
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 0705fb4..f42b0f6 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -35,10 +35,6 @@ bool cmTargetLinkLibrariesCommand
->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
if(!this->Target)
{
- this->Target = this->Makefile->FindTargetToUse(args[0].c_str());
- }
- if(!this->Target)
- {
cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
cmOStringStream e;
e << "Cannot specify link libraries for target \"" << args[0] << "\" "
@@ -261,16 +257,6 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
// Handle normal case first.
if(this->CurrentProcessingState != ProcessingLinkInterface)
{
- if (this->Target->IsImported())
- {
- cmOStringStream e;
- e << "Imported targets may only be used with the "
- "LINK_INTERFACE_LIBRARIES specifier to target_link_libraries.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
- return;
- }
-
-
this->Makefile
->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
if (this->CurrentProcessingState != ProcessingPublicInterface)
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 7f15dcb..e1eb1d2 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -88,9 +88,9 @@ bool cmTargetPropCommandBase
return false;
}
- if(this->Target->IsImported() && scope != "INTERFACE")
+ if(this->Target->IsImported())
{
- this->HandleImportedTargetInvalidScope(args[0], scope);
+ this->HandleImportedTarget(args[0]);
return false;
}
diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h
index e757f9d..15a78c9 100644
--- a/Source/cmTargetPropCommandBase.h
+++ b/Source/cmTargetPropCommandBase.h
@@ -32,8 +32,7 @@ public:
const char *prop, ArgumentFlags flags = NO_FLAGS);
private:
- virtual void HandleImportedTargetInvalidScope(const std::string &tgt,
- const std::string &scope) = 0;
+ virtual void HandleImportedTarget(const std::string &tgt) = 0;
virtual void HandleMissingTarget(const std::string &name) = 0;
virtual bool HandleNonTargetArg(std::string &content,