|
|
@@ -866,6 +866,13 @@ void cmTarget::DefineProperties(cmake *cm)
|
|
|
"This property is the configuration-specific version of "
|
|
|
"OSX_ARCHITECTURES.");
|
|
|
|
|
|
+ cm->DefineProperty
|
|
|
+ ("EXPORT_NAME", cmProperty::TARGET,
|
|
|
+ "Exported name for target files.",
|
|
|
+ "This sets the name for the IMPORTED target generated when it this "
|
|
|
+ "target is is exported. "
|
|
|
+ "If not set, the logical target name is used by default.");
|
|
|
+
|
|
|
cm->DefineProperty
|
|
|
("OUTPUT_NAME", cmProperty::TARGET,
|
|
|
"Output name for target files.",
|
|
|
@@ -2719,6 +2726,14 @@ void cmTarget::SetProperty(const char* prop, const char* value)
|
|
|
new cmTargetInternals::IncludeDirectoriesEntry(cge));
|
|
|
return;
|
|
|
}
|
|
|
+ if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
|
|
+ {
|
|
|
+ cmOStringStream e;
|
|
|
+ e << "EXPORT_NAME property can't be set on imported targets (\""
|
|
|
+ << this->Name << "\")\n";
|
|
|
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (strcmp(prop, "LINK_LIBRARIES") == 0)
|
|
|
{
|
|
|
this->Internal->LinkInterfaceIncludeDirectoriesEntries.clear();
|
|
|
@@ -2753,6 +2768,14 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
|
|
|
new cmTargetInternals::IncludeDirectoriesEntry(ge.Parse(value)));
|
|
|
return;
|
|
|
}
|
|
|
+ if(strcmp(prop,"EXPORT_NAME") == 0 && this->IsImported())
|
|
|
+ {
|
|
|
+ cmOStringStream e;
|
|
|
+ e << "EXPORT_NAME property can't be set on imported targets (\""
|
|
|
+ << this->Name << "\")\n";
|
|
|
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (strcmp(prop, "LINK_LIBRARIES") == 0)
|
|
|
{
|
|
|
if (cmGeneratorExpression::IsValidTargetName(value)
|
|
|
@@ -2769,6 +2792,26 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
|
|
|
this->MaybeInvalidatePropertyCache(prop);
|
|
|
}
|
|
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
+const char* cmTarget::GetExportName()
|
|
|
+{
|
|
|
+ const char *exportName = this->GetProperty("EXPORT_NAME");
|
|
|
+
|
|
|
+ if (exportName && *exportName)
|
|
|
+ {
|
|
|
+ if (!cmGeneratorExpression::IsValidTargetName(exportName))
|
|
|
+ {
|
|
|
+ cmOStringStream e;
|
|
|
+ e << "EXPORT_NAME property \"" << exportName << "\" for \""
|
|
|
+ << this->GetName() << "\": is not valid.";
|
|
|
+ cmSystemTools::Error(e.str().c_str());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return exportName;
|
|
|
+ }
|
|
|
+ return this->GetName();
|
|
|
+}
|
|
|
+
|
|
|
//----------------------------------------------------------------------------
|
|
|
void cmTarget::AppendBuildInterfaceIncludes()
|
|
|
{
|