summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index cfc339c..ba47637 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -100,12 +100,6 @@ bool cmExportCommand
fname += this->Filename.GetString();
}
- // If no targets are to be exported we are done.
- if(this->Targets.GetVector().empty())
- {
- return true;
- }
-
// Collect the targets to be exported.
std::vector<cmTarget*> targets;
for(std::vector<std::string>::const_iterator
@@ -149,6 +143,7 @@ bool cmExportCommand
ebfg.SetNamespace(this->Namespace.GetCString());
ebfg.SetAppendMode(this->Append.IsEnabled());
ebfg.SetExports(&targets);
+ ebfg.SetCommand(this);
// Compute the set of configurations exported.
if(const char* types =
@@ -180,5 +175,12 @@ bool cmExportCommand
return false;
}
+ // Report generated error message if any.
+ if(!this->ErrorMessage.empty())
+ {
+ this->SetError(this->ErrorMessage.c_str());
+ return false;
+ }
+
return true;
}