summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-06-26 10:53:40 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-26 10:53:40 (GMT)
commitedec1c261519525acd01ad67192f777fa071c50b (patch)
tree7b7f26177b66fd289cbfe9d5563564b7c5e044ca /Source
parent7113b943463d4a9c9df7d7385856394cbcfe8de7 (diff)
parent2ba5c37b3fed00ecc307b1d93780acd4a57695eb (diff)
downloadCMake-edec1c261519525acd01ad67192f777fa071c50b.zip
CMake-edec1c261519525acd01ad67192f777fa071c50b.tar.gz
CMake-edec1c261519525acd01ad67192f777fa071c50b.tar.bz2
Merge branch 'export-targets-empty' into release-3.15
Merge-request: !3484
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportCommand.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 5b611c0..a849aa2 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -4,6 +4,8 @@
#include "cm_static_string_view.hxx"
#include "cmsys/RegularExpression.hxx"
+
+#include <algorithm>
#include <map>
#include <sstream>
#include <utility>
@@ -66,7 +68,9 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
}
std::vector<std::string> unknownArgs;
- Arguments const arguments = parser.Parse(args, &unknownArgs);
+ std::vector<std::string> keywordsMissingValue;
+ Arguments const arguments =
+ parser.Parse(args, &unknownArgs, &keywordsMissingValue);
if (!unknownArgs.empty()) {
this->SetError("Unknown argument: \"" + unknownArgs.front() + "\".");
@@ -128,7 +132,10 @@ bool cmExportCommand::InitialPass(std::vector<std::string> const& args,
return false;
}
ExportSet = it->second;
- } else if (!arguments.Targets.empty()) {
+ } else if (!arguments.Targets.empty() ||
+ std::find(keywordsMissingValue.begin(),
+ keywordsMissingValue.end(),
+ "TARGETS") != keywordsMissingValue.end()) {
for (std::string const& currentTarget : arguments.Targets) {
if (this->Makefile->IsAlias(currentTarget)) {
std::ostringstream e;