summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmCommands.cxx5
-rw-r--r--Source/cmIncludeRegularExpressionCommand.cxx18
-rw-r--r--Source/cmIncludeRegularExpressionCommand.h30
3 files changed, 13 insertions, 40 deletions
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index a82559d..6f01bea 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -233,9 +233,8 @@ void GetProjectCommands(cmState* state)
state->AddBuiltinCommand("get_test_property", cmGetTestPropertyCommand);
state->AddBuiltinCommand("include_directories",
cm::make_unique<cmIncludeDirectoryCommand>());
- state->AddBuiltinCommand(
- "include_regular_expression",
- cm::make_unique<cmIncludeRegularExpressionCommand>());
+ state->AddBuiltinCommand("include_regular_expression",
+ cmIncludeRegularExpressionCommand);
state->AddBuiltinCommand("install", cm::make_unique<cmInstallCommand>());
state->AddBuiltinCommand("install_files",
cm::make_unique<cmInstallFilesCommand>());
diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx
index 073c95f..655ebd6 100644
--- a/Source/cmIncludeRegularExpressionCommand.cxx
+++ b/Source/cmIncludeRegularExpressionCommand.cxx
@@ -2,22 +2,22 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmIncludeRegularExpressionCommand.h"
+#include "cmExecutionStatus.h"
#include "cmMakefile.h"
-class cmExecutionStatus;
-
-// cmIncludeRegularExpressionCommand
-bool cmIncludeRegularExpressionCommand::InitialPass(
- std::vector<std::string> const& args, cmExecutionStatus&)
+bool cmIncludeRegularExpressionCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status)
{
- if ((args.empty()) || (args.size() > 2)) {
- this->SetError("called with incorrect number of arguments");
+ if (args.empty() || args.size() > 2) {
+ status.SetError("called with incorrect number of arguments");
return false;
}
- this->Makefile->SetIncludeRegularExpression(args[0].c_str());
+
+ cmMakefile& mf = status.GetMakefile();
+ mf.SetIncludeRegularExpression(args[0].c_str());
if (args.size() > 1) {
- this->Makefile->SetComplainRegularExpression(args[1]);
+ mf.SetComplainRegularExpression(args[1]);
}
return true;
diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h
index 1723c8b..ca152b0 100644
--- a/Source/cmIncludeRegularExpressionCommand.h
+++ b/Source/cmIncludeRegularExpressionCommand.h
@@ -8,35 +8,9 @@
#include <string>
#include <vector>
-#include "cm_memory.hxx"
-
-#include "cmCommand.h"
-
class cmExecutionStatus;
-/** \class cmIncludeRegularExpressionCommand
- * \brief Set the regular expression for following #includes.
- *
- * cmIncludeRegularExpressionCommand is used to specify the regular expression
- * that determines whether to follow a #include file in dependency checking.
- */
-class cmIncludeRegularExpressionCommand : public cmCommand
-{
-public:
- /**
- * This is a virtual constructor for the command.
- */
- std::unique_ptr<cmCommand> Clone() override
- {
- return cm::make_unique<cmIncludeRegularExpressionCommand>();
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
- bool InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus& status) override;
-};
+bool cmIncludeRegularExpressionCommand(std::vector<std::string> const& args,
+ cmExecutionStatus& status);
#endif