2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2001-03-15 23:09:16 +00:00
|
|
|
#include "cmIncludeRegularExpressionCommand.h"
|
|
|
|
|
2019-09-12 08:16:43 +00:00
|
|
|
#include "cmExecutionStatus.h"
|
2016-10-25 18:35:04 +00:00
|
|
|
#include "cmMakefile.h"
|
|
|
|
|
2019-09-12 08:16:43 +00:00
|
|
|
bool cmIncludeRegularExpressionCommand(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus& status)
|
2001-03-15 23:09:16 +00:00
|
|
|
{
|
2019-09-12 08:16:43 +00:00
|
|
|
if (args.empty() || args.size() > 2) {
|
|
|
|
status.SetError("called with incorrect number of arguments");
|
2001-03-15 23:09:16 +00:00
|
|
|
return false;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2019-09-12 08:16:43 +00:00
|
|
|
|
|
|
|
cmMakefile& mf = status.GetMakefile();
|
|
|
|
mf.SetIncludeRegularExpression(args[0].c_str());
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
if (args.size() > 1) {
|
2019-09-12 08:16:43 +00:00
|
|
|
mf.SetComplainRegularExpression(args[1]);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2001-03-15 23:09:16 +00:00
|
|
|
return true;
|
|
|
|
}
|