summaryrefslogtreecommitdiffstats
path: root/Source/cmAddLibraryCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmAddLibraryCommand.cxx')
-rw-r--r--Source/cmAddLibraryCommand.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 130a033..0e61c99 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -220,6 +220,16 @@ bool cmAddLibraryCommand
);
return true;
}
+ if(type == cmTarget::INTERFACE_LIBRARY)
+ {
+ if (!cmGeneratorExpression::IsValidTargetName(libName))
+ {
+ cmOStringStream e;
+ e << "Invalid name for IMPORTED INTERFACE library target: " << libName;
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ }
// Make sure the target does not already exist.
if(this->Makefile->FindTargetToUse(libName.c_str()))