mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Merge topic 'command-name'
a1218f59cmCommand: remove unused methods from interface and all implementations4ba25a82cmState: separate builtin and scripted commandsa44dab46cmState: introduce method for adding scripted commandsc734c850CTest: use new methods for builtin commandsbd14e464cmCommands: use new methods for builtin commands58708405cmState: introduce methods for adding builtin commandsa890ca2fcmakemain: use script role for -P Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !829
This commit is contained in:
@@ -42,14 +42,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "ctest_empty_binary_directory";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,11 @@ class cmCTestHandlerCommand : public cmCTestCommand
|
||||
public:
|
||||
cmCTestHandlerCommand();
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
virtual std::string GetName() const = 0;
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "cmCTestMemCheckCommand.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cmCTest.h"
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#include "cmCTestTestCommand.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class cmCTestGenericHandler;
|
||||
class cmCommand;
|
||||
|
||||
@@ -33,11 +31,6 @@ public:
|
||||
return ni;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "ctest_memcheck"; }
|
||||
|
||||
protected:
|
||||
cmCTestGenericHandler* InitializeActualHandler() CM_OVERRIDE;
|
||||
|
||||
|
||||
@@ -40,11 +40,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "ctest_read_custom_files"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,11 +41,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "ctest_run_script"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -166,12 +166,12 @@ void cmCTestScriptHandler::UpdateElapsedTime()
|
||||
}
|
||||
}
|
||||
|
||||
void cmCTestScriptHandler::AddCTestCommand(cmCTestCommand* command)
|
||||
void cmCTestScriptHandler::AddCTestCommand(std::string const& name,
|
||||
cmCTestCommand* command)
|
||||
{
|
||||
cmCTestCommand* newCom = command;
|
||||
newCom->CTest = this->CTest;
|
||||
newCom->CTestScriptHandler = this;
|
||||
this->CMake->GetState()->AddCommand(newCom);
|
||||
command->CTest = this->CTest;
|
||||
command->CTestScriptHandler = this;
|
||||
this->CMake->GetState()->AddBuiltinCommand(name, command);
|
||||
}
|
||||
|
||||
int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
|
||||
@@ -290,22 +290,21 @@ void cmCTestScriptHandler::CreateCMake()
|
||||
|
||||
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
|
||||
|
||||
// add any ctest specific commands, probably should have common superclass
|
||||
// for ctest commands to clean this up. If a couple more commands are
|
||||
// created with the same format lets do that - ken
|
||||
this->AddCTestCommand(new cmCTestBuildCommand);
|
||||
this->AddCTestCommand(new cmCTestConfigureCommand);
|
||||
this->AddCTestCommand(new cmCTestCoverageCommand);
|
||||
this->AddCTestCommand(new cmCTestEmptyBinaryDirectoryCommand);
|
||||
this->AddCTestCommand(new cmCTestMemCheckCommand);
|
||||
this->AddCTestCommand(new cmCTestReadCustomFilesCommand);
|
||||
this->AddCTestCommand(new cmCTestRunScriptCommand);
|
||||
this->AddCTestCommand(new cmCTestSleepCommand);
|
||||
this->AddCTestCommand(new cmCTestStartCommand);
|
||||
this->AddCTestCommand(new cmCTestSubmitCommand);
|
||||
this->AddCTestCommand(new cmCTestTestCommand);
|
||||
this->AddCTestCommand(new cmCTestUpdateCommand);
|
||||
this->AddCTestCommand(new cmCTestUploadCommand);
|
||||
this->AddCTestCommand("ctest_build", new cmCTestBuildCommand);
|
||||
this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand);
|
||||
this->AddCTestCommand("ctest_coverage", new cmCTestCoverageCommand);
|
||||
this->AddCTestCommand("ctest_empty_binary_directory",
|
||||
new cmCTestEmptyBinaryDirectoryCommand);
|
||||
this->AddCTestCommand("ctest_memcheck", new cmCTestMemCheckCommand);
|
||||
this->AddCTestCommand("ctest_read_custom_files",
|
||||
new cmCTestReadCustomFilesCommand);
|
||||
this->AddCTestCommand("ctest_run_script", new cmCTestRunScriptCommand);
|
||||
this->AddCTestCommand("ctest_sleep", new cmCTestSleepCommand);
|
||||
this->AddCTestCommand("ctest_start", new cmCTestStartCommand);
|
||||
this->AddCTestCommand("ctest_submit", new cmCTestSubmitCommand);
|
||||
this->AddCTestCommand("ctest_test", new cmCTestTestCommand);
|
||||
this->AddCTestCommand("ctest_update", new cmCTestUpdateCommand);
|
||||
this->AddCTestCommand("ctest_upload", new cmCTestUploadCommand);
|
||||
}
|
||||
|
||||
// this sets up some variables for the script to use, creates the required
|
||||
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
int RunConfigurationDashboard();
|
||||
|
||||
// Add ctest command
|
||||
void AddCTestCommand(cmCTestCommand* command);
|
||||
void AddCTestCommand(std::string const& name, cmCTestCommand* command);
|
||||
|
||||
// Try to remove the binary directory once
|
||||
static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
|
||||
|
||||
@@ -41,11 +41,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "ctest_sleep"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,11 +54,6 @@ public:
|
||||
*/
|
||||
bool ShouldBeQuiet() { return this->Quiet; }
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "ctest_start"; }
|
||||
|
||||
private:
|
||||
bool InitialCheckout(std::ostream& ofs, std::string const& sourceDir);
|
||||
bool CreateNewTag;
|
||||
|
||||
@@ -56,11 +56,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& /*unused*/) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "subdirs"; }
|
||||
|
||||
cmCTestTestHandler* TestHandler;
|
||||
};
|
||||
|
||||
@@ -136,11 +131,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& /*unused*/) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; }
|
||||
|
||||
cmCTestTestHandler* TestHandler;
|
||||
};
|
||||
|
||||
@@ -206,11 +196,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& /*args*/,
|
||||
cmExecutionStatus& /*unused*/) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_test"; }
|
||||
|
||||
cmCTestTestHandler* TestHandler;
|
||||
};
|
||||
|
||||
@@ -244,11 +229,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& /*args*/,
|
||||
cmExecutionStatus& /*unused*/) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; }
|
||||
|
||||
cmCTestTestHandler* TestHandler;
|
||||
};
|
||||
|
||||
@@ -1662,23 +1642,23 @@ void cmCTestTestHandler::GetListOfTests()
|
||||
// Add handler for ADD_TEST
|
||||
cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand;
|
||||
newCom1->TestHandler = this;
|
||||
cm.GetState()->AddCommand(newCom1);
|
||||
cm.GetState()->AddBuiltinCommand("add_test", newCom1);
|
||||
|
||||
// Add handler for SUBDIRS
|
||||
cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand;
|
||||
newCom2->TestHandler = this;
|
||||
cm.GetState()->AddCommand(newCom2);
|
||||
cm.GetState()->AddBuiltinCommand("subdirs", newCom2);
|
||||
|
||||
// Add handler for ADD_SUBDIRECTORY
|
||||
cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand;
|
||||
newCom3->TestHandler = this;
|
||||
cm.GetState()->AddCommand(newCom3);
|
||||
cm.GetState()->AddBuiltinCommand("add_subdirectory", newCom3);
|
||||
|
||||
// Add handler for SET_SOURCE_FILES_PROPERTIES
|
||||
// Add handler for SET_TESTS_PROPERTIES
|
||||
cmCTestSetTestsPropertiesCommand* newCom4 =
|
||||
new cmCTestSetTestsPropertiesCommand;
|
||||
newCom4->TestHandler = this;
|
||||
cm.GetState()->AddCommand(newCom4);
|
||||
cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4);
|
||||
|
||||
const char* testFilename;
|
||||
if (cmSystemTools::FileExists("CTestTestfile.cmake")) {
|
||||
|
||||
@@ -26,11 +26,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_compile_options"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_custom_command"; }
|
||||
|
||||
protected:
|
||||
bool CheckOutputs(const std::vector<std::string>& outputs);
|
||||
};
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_custom_target"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_definitions"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_dependencies"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_executable"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_library"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "add_test"; }
|
||||
|
||||
private:
|
||||
bool HandleNameMode(std::vector<std::string> const& args);
|
||||
};
|
||||
|
||||
@@ -35,11 +35,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "aux_source_directory"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "break"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,11 +42,6 @@ public:
|
||||
*/
|
||||
virtual bool TwoArgsSignature(std::vector<std::string> const& args);
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "build_command"; }
|
||||
|
||||
private:
|
||||
bool IgnoreErrors() const;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmBuildNameCommand; }
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
std::string GetName() const CM_OVERRIDE { return "build_name"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -40,14 +40,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "cmake_host_system_information";
|
||||
}
|
||||
|
||||
private:
|
||||
bool GetValue(cmsys::SystemInformation& info, std::string const& key,
|
||||
std::string& value);
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "cmake_minimum_required"; }
|
||||
|
||||
private:
|
||||
std::vector<std::string> UnknownArguments;
|
||||
bool EnforceUnknownArguments();
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "cmake_policy"; }
|
||||
|
||||
private:
|
||||
bool HandleSetMode(std::vector<std::string> const& args);
|
||||
bool HandleGetMode(std::vector<std::string> const& args);
|
||||
|
||||
@@ -79,17 +79,6 @@ public:
|
||||
*/
|
||||
virtual cmCommand* Clone() = 0;
|
||||
|
||||
/**
|
||||
* This determines if the command is defined in a cmake script.
|
||||
* It is the case for cmMacroHelperCommand and cmFunctionHelperCommand.
|
||||
*/
|
||||
virtual bool IsUserDefined() const { return false; }
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
virtual std::string GetName() const = 0;
|
||||
|
||||
/**
|
||||
* Return the last error string.
|
||||
*/
|
||||
|
||||
+156
-132
@@ -70,7 +70,6 @@
|
||||
#include "cmTargetLinkLibrariesCommand.h"
|
||||
#include "cmTryCompileCommand.h"
|
||||
#include "cmTryRunCommand.h"
|
||||
#include "cmUnexpectedCommand.h"
|
||||
#include "cmUnsetCommand.h"
|
||||
#include "cmWhileCommand.h"
|
||||
|
||||
@@ -79,7 +78,6 @@
|
||||
#include "cmAuxSourceDirectoryCommand.h"
|
||||
#include "cmBuildNameCommand.h"
|
||||
#include "cmCMakeHostSystemInformationCommand.h"
|
||||
#include "cmDisallowedCommand.h"
|
||||
#include "cmExportCommand.h"
|
||||
#include "cmExportLibraryDependenciesCommand.h"
|
||||
#include "cmFLTKWrapUICommand.h"
|
||||
@@ -109,169 +107,195 @@
|
||||
|
||||
void GetScriptingCommands(cmState* state)
|
||||
{
|
||||
state->AddCommand(new cmBreakCommand);
|
||||
state->AddCommand(new cmCMakeMinimumRequired);
|
||||
state->AddCommand(new cmCMakePolicyCommand);
|
||||
state->AddCommand(new cmConfigureFileCommand);
|
||||
state->AddCommand(new cmContinueCommand);
|
||||
state->AddCommand(new cmExecProgramCommand);
|
||||
state->AddCommand(new cmExecuteProcessCommand);
|
||||
state->AddCommand(new cmFileCommand);
|
||||
state->AddCommand(new cmFindFileCommand);
|
||||
state->AddCommand(new cmFindLibraryCommand);
|
||||
state->AddCommand(new cmFindPackageCommand);
|
||||
state->AddCommand(new cmFindPathCommand);
|
||||
state->AddCommand(new cmFindProgramCommand);
|
||||
state->AddCommand(new cmForEachCommand);
|
||||
state->AddCommand(new cmFunctionCommand);
|
||||
state->AddCommand(new cmGetCMakePropertyCommand);
|
||||
state->AddCommand(new cmGetDirectoryPropertyCommand);
|
||||
state->AddCommand(new cmGetFilenameComponentCommand);
|
||||
state->AddCommand(new cmGetPropertyCommand);
|
||||
state->AddCommand(new cmIfCommand);
|
||||
state->AddCommand(new cmIncludeCommand);
|
||||
state->AddCommand(new cmListCommand);
|
||||
state->AddCommand(new cmMacroCommand);
|
||||
state->AddCommand(new cmMakeDirectoryCommand);
|
||||
state->AddCommand(new cmMarkAsAdvancedCommand);
|
||||
state->AddCommand(new cmMathCommand);
|
||||
state->AddCommand(new cmMessageCommand);
|
||||
state->AddCommand(new cmOptionCommand);
|
||||
state->AddCommand(new cmParseArgumentsCommand);
|
||||
state->AddCommand(new cmReturnCommand);
|
||||
state->AddCommand(new cmSeparateArgumentsCommand);
|
||||
state->AddCommand(new cmSetCommand);
|
||||
state->AddCommand(new cmSetDirectoryPropertiesCommand);
|
||||
state->AddCommand(new cmSetPropertyCommand);
|
||||
state->AddCommand(new cmSiteNameCommand);
|
||||
state->AddCommand(new cmStringCommand);
|
||||
state->AddCommand(new cmUnsetCommand);
|
||||
state->AddCommand(new cmWhileCommand);
|
||||
state->AddBuiltinCommand("break", new cmBreakCommand);
|
||||
state->AddBuiltinCommand("cmake_minimum_required",
|
||||
new cmCMakeMinimumRequired);
|
||||
state->AddBuiltinCommand("cmake_policy", new cmCMakePolicyCommand);
|
||||
state->AddBuiltinCommand("configure_file", new cmConfigureFileCommand);
|
||||
state->AddBuiltinCommand("continue", new cmContinueCommand);
|
||||
state->AddBuiltinCommand("exec_program", new cmExecProgramCommand);
|
||||
state->AddBuiltinCommand("execute_process", new cmExecuteProcessCommand);
|
||||
state->AddBuiltinCommand("file", new cmFileCommand);
|
||||
state->AddBuiltinCommand("find_file", new cmFindFileCommand);
|
||||
state->AddBuiltinCommand("find_library", new cmFindLibraryCommand);
|
||||
state->AddBuiltinCommand("find_package", new cmFindPackageCommand);
|
||||
state->AddBuiltinCommand("find_path", new cmFindPathCommand);
|
||||
state->AddBuiltinCommand("find_program", new cmFindProgramCommand);
|
||||
state->AddBuiltinCommand("foreach", new cmForEachCommand);
|
||||
state->AddBuiltinCommand("function", new cmFunctionCommand);
|
||||
state->AddBuiltinCommand("get_cmake_property",
|
||||
new cmGetCMakePropertyCommand);
|
||||
state->AddBuiltinCommand("get_directory_property",
|
||||
new cmGetDirectoryPropertyCommand);
|
||||
state->AddBuiltinCommand("get_filename_component",
|
||||
new cmGetFilenameComponentCommand);
|
||||
state->AddBuiltinCommand("get_property", new cmGetPropertyCommand);
|
||||
state->AddBuiltinCommand("if", new cmIfCommand);
|
||||
state->AddBuiltinCommand("include", new cmIncludeCommand);
|
||||
state->AddBuiltinCommand("list", new cmListCommand);
|
||||
state->AddBuiltinCommand("macro", new cmMacroCommand);
|
||||
state->AddBuiltinCommand("make_directory", new cmMakeDirectoryCommand);
|
||||
state->AddBuiltinCommand("mark_as_advanced", new cmMarkAsAdvancedCommand);
|
||||
state->AddBuiltinCommand("math", new cmMathCommand);
|
||||
state->AddBuiltinCommand("message", new cmMessageCommand);
|
||||
state->AddBuiltinCommand("option", new cmOptionCommand);
|
||||
state->AddBuiltinCommand("cmake_parse_arguments",
|
||||
new cmParseArgumentsCommand);
|
||||
state->AddBuiltinCommand("return", new cmReturnCommand);
|
||||
state->AddBuiltinCommand("separate_arguments",
|
||||
new cmSeparateArgumentsCommand);
|
||||
state->AddBuiltinCommand("set", new cmSetCommand);
|
||||
state->AddBuiltinCommand("set_directory_properties",
|
||||
new cmSetDirectoryPropertiesCommand);
|
||||
state->AddBuiltinCommand("set_property", new cmSetPropertyCommand);
|
||||
state->AddBuiltinCommand("site_name", new cmSiteNameCommand);
|
||||
state->AddBuiltinCommand("string", new cmStringCommand);
|
||||
state->AddBuiltinCommand("unset", new cmUnsetCommand);
|
||||
state->AddBuiltinCommand("while", new cmWhileCommand);
|
||||
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
state->AddUnexpectedCommand(
|
||||
"else", "An ELSE command was found outside of a proper "
|
||||
"IF ENDIF structure. Or its arguments did not match "
|
||||
"the opening IF command."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"the opening IF command.");
|
||||
state->AddUnexpectedCommand(
|
||||
"elseif", "An ELSEIF command was found outside of a proper "
|
||||
"IF ENDIF structure."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"IF ENDIF structure.");
|
||||
state->AddUnexpectedCommand(
|
||||
"endforeach", "An ENDFOREACH command was found outside of a proper "
|
||||
"FOREACH ENDFOREACH structure. Or its arguments did "
|
||||
"not match the opening FOREACH command."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"not match the opening FOREACH command.");
|
||||
state->AddUnexpectedCommand(
|
||||
"endfunction", "An ENDFUNCTION command was found outside of a proper "
|
||||
"FUNCTION ENDFUNCTION structure. Or its arguments did not "
|
||||
"match the opening FUNCTION command."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"match the opening FUNCTION command.");
|
||||
state->AddUnexpectedCommand(
|
||||
"endif", "An ENDIF command was found outside of a proper "
|
||||
"IF ENDIF structure. Or its arguments did not match "
|
||||
"the opening IF command."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"the opening IF command.");
|
||||
state->AddUnexpectedCommand(
|
||||
"endmacro", "An ENDMACRO command was found outside of a proper "
|
||||
"MACRO ENDMACRO structure. Or its arguments did not "
|
||||
"match the opening MACRO command."));
|
||||
state->AddCommand(new cmUnexpectedCommand(
|
||||
"match the opening MACRO command.");
|
||||
state->AddUnexpectedCommand(
|
||||
"endwhile", "An ENDWHILE command was found outside of a proper "
|
||||
"WHILE ENDWHILE structure. Or its arguments did not "
|
||||
"match the opening WHILE command."));
|
||||
"match the opening WHILE command.");
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
state->AddCommand(new cmCMakeHostSystemInformationCommand);
|
||||
state->AddCommand(new cmRemoveCommand);
|
||||
state->AddCommand(new cmVariableWatchCommand);
|
||||
state->AddCommand(new cmWriteFileCommand);
|
||||
state->AddBuiltinCommand("cmake_host_system_information",
|
||||
new cmCMakeHostSystemInformationCommand);
|
||||
state->AddBuiltinCommand("remove", new cmRemoveCommand);
|
||||
state->AddBuiltinCommand("variable_watch", new cmVariableWatchCommand);
|
||||
state->AddBuiltinCommand("write_file", new cmWriteFileCommand);
|
||||
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmBuildNameCommand, cmPolicies::CMP0036,
|
||||
"The build_name command should not be called; see CMP0036."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmUseMangledMesaCommand, cmPolicies::CMP0030,
|
||||
"The use_mangled_mesa command should not be called; see CMP0030."));
|
||||
state->AddDisallowedCommand(
|
||||
"build_name", new cmBuildNameCommand, cmPolicies::CMP0036,
|
||||
"The build_name command should not be called; see CMP0036.");
|
||||
state->AddDisallowedCommand(
|
||||
"use_mangled_mesa", new cmUseMangledMesaCommand, cmPolicies::CMP0030,
|
||||
"The use_mangled_mesa command should not be called; see CMP0030.");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void GetProjectCommands(cmState* state)
|
||||
{
|
||||
state->AddCommand(new cmAddCustomCommandCommand);
|
||||
state->AddCommand(new cmAddCustomTargetCommand);
|
||||
state->AddCommand(new cmAddDefinitionsCommand);
|
||||
state->AddCommand(new cmAddDependenciesCommand);
|
||||
state->AddCommand(new cmAddExecutableCommand);
|
||||
state->AddCommand(new cmAddLibraryCommand);
|
||||
state->AddCommand(new cmAddSubDirectoryCommand);
|
||||
state->AddCommand(new cmAddTestCommand);
|
||||
state->AddCommand(new cmBuildCommand);
|
||||
state->AddCommand(new cmCreateTestSourceList);
|
||||
state->AddCommand(new cmDefinePropertyCommand);
|
||||
state->AddCommand(new cmEnableLanguageCommand);
|
||||
state->AddCommand(new cmEnableTestingCommand);
|
||||
state->AddCommand(new cmGetSourceFilePropertyCommand);
|
||||
state->AddCommand(new cmGetTargetPropertyCommand);
|
||||
state->AddCommand(new cmGetTestPropertyCommand);
|
||||
state->AddCommand(new cmIncludeDirectoryCommand);
|
||||
state->AddCommand(new cmIncludeRegularExpressionCommand);
|
||||
state->AddCommand(new cmInstallCommand);
|
||||
state->AddCommand(new cmInstallFilesCommand);
|
||||
state->AddCommand(new cmInstallTargetsCommand);
|
||||
state->AddCommand(new cmLinkDirectoriesCommand);
|
||||
state->AddCommand(new cmProjectCommand);
|
||||
state->AddCommand(new cmSetSourceFilesPropertiesCommand);
|
||||
state->AddCommand(new cmSetTargetPropertiesCommand);
|
||||
state->AddCommand(new cmSetTestsPropertiesCommand);
|
||||
state->AddCommand(new cmSubdirCommand);
|
||||
state->AddCommand(new cmTargetLinkLibrariesCommand);
|
||||
state->AddCommand(new cmTryCompileCommand);
|
||||
state->AddCommand(new cmTryRunCommand);
|
||||
state->AddBuiltinCommand("add_custom_command",
|
||||
new cmAddCustomCommandCommand);
|
||||
state->AddBuiltinCommand("add_custom_target", new cmAddCustomTargetCommand);
|
||||
state->AddBuiltinCommand("add_definitions", new cmAddDefinitionsCommand);
|
||||
state->AddBuiltinCommand("add_dependencies", new cmAddDependenciesCommand);
|
||||
state->AddBuiltinCommand("add_executable", new cmAddExecutableCommand);
|
||||
state->AddBuiltinCommand("add_library", new cmAddLibraryCommand);
|
||||
state->AddBuiltinCommand("add_subdirectory", new cmAddSubDirectoryCommand);
|
||||
state->AddBuiltinCommand("add_test", new cmAddTestCommand);
|
||||
state->AddBuiltinCommand("build_command", new cmBuildCommand);
|
||||
state->AddBuiltinCommand("create_test_sourcelist",
|
||||
new cmCreateTestSourceList);
|
||||
state->AddBuiltinCommand("define_property", new cmDefinePropertyCommand);
|
||||
state->AddBuiltinCommand("enable_language", new cmEnableLanguageCommand);
|
||||
state->AddBuiltinCommand("enable_testing", new cmEnableTestingCommand);
|
||||
state->AddBuiltinCommand("get_source_file_property",
|
||||
new cmGetSourceFilePropertyCommand);
|
||||
state->AddBuiltinCommand("get_target_property",
|
||||
new cmGetTargetPropertyCommand);
|
||||
state->AddBuiltinCommand("get_test_property", new cmGetTestPropertyCommand);
|
||||
state->AddBuiltinCommand("include_directories",
|
||||
new cmIncludeDirectoryCommand);
|
||||
state->AddBuiltinCommand("include_regular_expression",
|
||||
new cmIncludeRegularExpressionCommand);
|
||||
state->AddBuiltinCommand("install", new cmInstallCommand);
|
||||
state->AddBuiltinCommand("install_files", new cmInstallFilesCommand);
|
||||
state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand);
|
||||
state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand);
|
||||
state->AddBuiltinCommand("project", new cmProjectCommand);
|
||||
state->AddBuiltinCommand("set_source_files_properties",
|
||||
new cmSetSourceFilesPropertiesCommand);
|
||||
state->AddBuiltinCommand("set_target_properties",
|
||||
new cmSetTargetPropertiesCommand);
|
||||
state->AddBuiltinCommand("set_tests_properties",
|
||||
new cmSetTestsPropertiesCommand);
|
||||
state->AddBuiltinCommand("subdirs", new cmSubdirCommand);
|
||||
state->AddBuiltinCommand("target_link_libraries",
|
||||
new cmTargetLinkLibrariesCommand);
|
||||
state->AddBuiltinCommand("try_compile", new cmTryCompileCommand);
|
||||
state->AddBuiltinCommand("try_run", new cmTryRunCommand);
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
state->AddCommand(new cmAddCompileOptionsCommand);
|
||||
state->AddCommand(new cmAuxSourceDirectoryCommand);
|
||||
state->AddCommand(new cmExportCommand);
|
||||
state->AddCommand(new cmFLTKWrapUICommand);
|
||||
state->AddCommand(new cmIncludeExternalMSProjectCommand);
|
||||
state->AddCommand(new cmInstallProgramsCommand);
|
||||
state->AddCommand(new cmLinkLibrariesCommand);
|
||||
state->AddCommand(new cmLoadCacheCommand);
|
||||
state->AddCommand(new cmQTWrapCPPCommand);
|
||||
state->AddCommand(new cmQTWrapUICommand);
|
||||
state->AddCommand(new cmRemoveDefinitionsCommand);
|
||||
state->AddCommand(new cmSourceGroupCommand);
|
||||
state->AddCommand(new cmTargetCompileDefinitionsCommand);
|
||||
state->AddCommand(new cmTargetCompileFeaturesCommand);
|
||||
state->AddCommand(new cmTargetCompileOptionsCommand);
|
||||
state->AddCommand(new cmTargetIncludeDirectoriesCommand);
|
||||
state->AddCommand(new cmTargetSourcesCommand);
|
||||
state->AddBuiltinCommand("add_compile_options",
|
||||
new cmAddCompileOptionsCommand);
|
||||
state->AddBuiltinCommand("aux_source_directory",
|
||||
new cmAuxSourceDirectoryCommand);
|
||||
state->AddBuiltinCommand("export", new cmExportCommand);
|
||||
state->AddBuiltinCommand("fltk_wrap_ui", new cmFLTKWrapUICommand);
|
||||
state->AddBuiltinCommand("include_external_msproject",
|
||||
new cmIncludeExternalMSProjectCommand);
|
||||
state->AddBuiltinCommand("install_programs", new cmInstallProgramsCommand);
|
||||
state->AddBuiltinCommand("link_libraries", new cmLinkLibrariesCommand);
|
||||
state->AddBuiltinCommand("load_cache", new cmLoadCacheCommand);
|
||||
state->AddBuiltinCommand("qt_wrap_cpp", new cmQTWrapCPPCommand);
|
||||
state->AddBuiltinCommand("qt_wrap_ui", new cmQTWrapUICommand);
|
||||
state->AddBuiltinCommand("remove_definitions",
|
||||
new cmRemoveDefinitionsCommand);
|
||||
state->AddBuiltinCommand("source_group", new cmSourceGroupCommand);
|
||||
state->AddBuiltinCommand("target_compile_definitions",
|
||||
new cmTargetCompileDefinitionsCommand);
|
||||
state->AddBuiltinCommand("target_compile_features",
|
||||
new cmTargetCompileFeaturesCommand);
|
||||
state->AddBuiltinCommand("target_compile_options",
|
||||
new cmTargetCompileOptionsCommand);
|
||||
state->AddBuiltinCommand("target_include_directories",
|
||||
new cmTargetIncludeDirectoriesCommand);
|
||||
state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand);
|
||||
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033,
|
||||
state->AddDisallowedCommand(
|
||||
"export_library_dependencies", new cmExportLibraryDependenciesCommand,
|
||||
cmPolicies::CMP0033,
|
||||
"The export_library_dependencies command should not be called; "
|
||||
"see CMP0033."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmLoadCommandCommand, cmPolicies::CMP0031,
|
||||
"The load_command command should not be called; see CMP0031."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmOutputRequiredFilesCommand, cmPolicies::CMP0032,
|
||||
"The output_required_files command should not be called; "
|
||||
"see CMP0032."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmSubdirDependsCommand, cmPolicies::CMP0029,
|
||||
"The subdir_depends command should not be called; see CMP0029."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmUtilitySourceCommand, cmPolicies::CMP0034,
|
||||
"The utility_source command should not be called; see CMP0034."));
|
||||
state->AddCommand(new cmDisallowedCommand(
|
||||
new cmVariableRequiresCommand, cmPolicies::CMP0035,
|
||||
"The variable_requires command should not be called; see CMP0035."));
|
||||
"see CMP0033.");
|
||||
state->AddDisallowedCommand(
|
||||
"load_command", new cmLoadCommandCommand, cmPolicies::CMP0031,
|
||||
"The load_command command should not be called; see CMP0031.");
|
||||
state->AddDisallowedCommand(
|
||||
"output_required_files", new cmOutputRequiredFilesCommand,
|
||||
cmPolicies::CMP0032,
|
||||
"The output_required_files command should not be called; see CMP0032.");
|
||||
state->AddDisallowedCommand(
|
||||
"subdir_depends", new cmSubdirDependsCommand, cmPolicies::CMP0029,
|
||||
"The subdir_depends command should not be called; see CMP0029.");
|
||||
state->AddDisallowedCommand(
|
||||
"utility_source", new cmUtilitySourceCommand, cmPolicies::CMP0034,
|
||||
"The utility_source command should not be called; see CMP0034.");
|
||||
state->AddDisallowedCommand(
|
||||
"variable_requires", new cmVariableRequiresCommand, cmPolicies::CMP0035,
|
||||
"The variable_requires command should not be called; see CMP0035.");
|
||||
#endif
|
||||
}
|
||||
|
||||
void GetProjectCommandsInScriptMode(cmState* state)
|
||||
{
|
||||
#define CM_UNEXPECTED_PROJECT_COMMAND(NAME) \
|
||||
state->AddCommand(new cmUnexpectedCommand(NAME, "command is not " \
|
||||
"scriptable"))
|
||||
state->AddUnexpectedCommand(NAME, "command is not scriptable")
|
||||
|
||||
CM_UNEXPECTED_PROJECT_COMMAND("add_compile_options");
|
||||
CM_UNEXPECTED_PROJECT_COMMAND("add_custom_command");
|
||||
|
||||
@@ -25,11 +25,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "configure_file"; }
|
||||
|
||||
private:
|
||||
int ConfigureFile();
|
||||
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "continue"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "create_test_sourcelist"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,11 +24,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "define_property"; }
|
||||
|
||||
private:
|
||||
std::string PropertyName;
|
||||
std::string BriefDocs;
|
||||
|
||||
@@ -42,8 +42,6 @@ public:
|
||||
return this->Command->HasFinalPass();
|
||||
}
|
||||
|
||||
std::string GetName() const CM_OVERRIDE { return this->Command->GetName(); }
|
||||
|
||||
private:
|
||||
cmCommand* Command;
|
||||
cmPolicies::PolicyID Policy;
|
||||
|
||||
@@ -34,11 +34,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "enable_language"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,11 +39,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const&,
|
||||
cmExecutionStatus&) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "enable_testing"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,11 +36,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "exec_program"; }
|
||||
|
||||
private:
|
||||
static bool RunCommand(const char* command, std::string& output, int& retVal,
|
||||
const char* directory = CM_NULLPTR,
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "execute_process"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,11 +36,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "export"; }
|
||||
|
||||
private:
|
||||
cmCommandArgumentsHelper Helper;
|
||||
cmCommandArgumentGroup ArgumentGroup;
|
||||
|
||||
@@ -21,10 +21,6 @@ public:
|
||||
}
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "export_library_dependencies";
|
||||
}
|
||||
|
||||
void FinalPass() CM_OVERRIDE;
|
||||
bool HasFinalPass() const CM_OVERRIDE { return true; }
|
||||
|
||||
@@ -43,11 +43,6 @@ public:
|
||||
void FinalPass() CM_OVERRIDE;
|
||||
bool HasFinalPass() const CM_OVERRIDE { return true; }
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "fltk_wrap_ui"; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* List of produced files.
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "file"; }
|
||||
|
||||
protected:
|
||||
bool HandleRename(std::vector<std::string> const& args);
|
||||
bool HandleRemove(std::vector<std::string> const& args, bool recurse);
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "cmConfigure.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "cmFindPathCommand.h"
|
||||
|
||||
class cmCommand;
|
||||
@@ -27,7 +25,6 @@ public:
|
||||
* This is a virtual constructor for the command.
|
||||
*/
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmFindFileCommand; }
|
||||
std::string GetName() const CM_OVERRIDE { return "find_file"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,11 +36,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "find_library"; }
|
||||
|
||||
protected:
|
||||
void AddArchitecturePaths(const char* suffix);
|
||||
void AddArchitecturePath(std::string const& dir,
|
||||
|
||||
@@ -60,11 +60,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "find_package"; }
|
||||
|
||||
private:
|
||||
class PathLabel : public cmFindCommon::PathLabel
|
||||
{
|
||||
|
||||
@@ -36,11 +36,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "find_path"; }
|
||||
|
||||
bool IncludeFileInPath;
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,11 +37,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "find_program"; }
|
||||
|
||||
private:
|
||||
std::string FindProgram();
|
||||
std::string FindNormalProgram();
|
||||
|
||||
@@ -48,11 +48,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "foreach"; }
|
||||
|
||||
private:
|
||||
bool HandleInMode(std::vector<std::string> const& args);
|
||||
};
|
||||
|
||||
@@ -20,11 +20,6 @@ public:
|
||||
///! clean up any memory allocated by the function
|
||||
~cmFunctionHelperCommand() CM_OVERRIDE {}
|
||||
|
||||
/**
|
||||
* This determines if the command is defined in a cmake script.
|
||||
*/
|
||||
bool IsUserDefined() const CM_OVERRIDE { return true; }
|
||||
|
||||
/**
|
||||
* This is a virtual constructor for the command.
|
||||
*/
|
||||
@@ -52,11 +47,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return this->Args[0]; }
|
||||
|
||||
std::vector<std::string> Args;
|
||||
std::vector<cmListFileFunction> Functions;
|
||||
cmPolicies::PolicyMap Policies;
|
||||
@@ -149,11 +139,7 @@ bool cmFunctionFunctionBlocker::IsFunctionBlocked(
|
||||
f->Functions = this->Functions;
|
||||
f->FilePath = this->GetStartingContext().FilePath;
|
||||
mf.RecordPolicies(f->Policies);
|
||||
|
||||
std::string newName = "_" + this->Args[0];
|
||||
mf.GetState()->RenameCommand(this->Args[0], newName);
|
||||
mf.GetState()->AddCommand(f);
|
||||
|
||||
mf.GetState()->AddScriptedCommand(this->Args[0], f);
|
||||
// remove the function blocker now that the function is defined
|
||||
mf.RemoveFunctionBlocker(this, lff);
|
||||
return true;
|
||||
|
||||
@@ -44,11 +44,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "function"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,11 +23,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_cmake_property"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,11 +24,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_directory_property"; }
|
||||
|
||||
private:
|
||||
void StoreResult(const std::string& variable, const char* prop);
|
||||
};
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_filename_component"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,11 +26,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_property"; }
|
||||
|
||||
private:
|
||||
enum OutType
|
||||
{
|
||||
|
||||
@@ -23,14 +23,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "get_source_file_property";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,11 +23,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_target_property"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,11 +23,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "get_test_property"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -64,11 +64,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "if"; }
|
||||
|
||||
// Filter the given variable definition based on policy CMP0054.
|
||||
static const char* GetDefinitionIfUnquoted(
|
||||
const cmMakefile* mf, cmExpandedCommandArgument const& argument);
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "include"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "include_directories"; }
|
||||
|
||||
protected:
|
||||
// used internally
|
||||
void GetIncludes(const std::string& arg, std::vector<std::string>& incs);
|
||||
|
||||
@@ -36,14 +36,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "include_external_msproject";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,14 +35,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "include_regular_expression";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "install"; }
|
||||
|
||||
private:
|
||||
bool HandleScriptMode(std::vector<std::string> const& args);
|
||||
bool HandleTargetsMode(std::vector<std::string> const& args);
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "install_files"; }
|
||||
|
||||
/**
|
||||
* This is called at the end after all the information
|
||||
* specified by the command is accumulated. Most commands do
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "install_programs"; }
|
||||
|
||||
/**
|
||||
* This is called at the end after all the information
|
||||
* specified by the command is accumulated. Most commands do
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "install_targets"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,11 +35,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "link_directories"; }
|
||||
|
||||
private:
|
||||
void AddLinkDir(std::string const& dir);
|
||||
};
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "link_libraries"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "list"; }
|
||||
|
||||
protected:
|
||||
bool HandleLengthCommand(std::vector<std::string> const& args);
|
||||
bool HandleGetCommand(std::vector<std::string> const& args);
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "load_cache"; }
|
||||
|
||||
protected:
|
||||
std::set<std::string> VariablesToRead;
|
||||
std::string Prefix;
|
||||
|
||||
@@ -66,11 +66,6 @@ public:
|
||||
return this->info.FinalPass != CM_NULLPTR;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return info.Name; }
|
||||
|
||||
static const char* LastName;
|
||||
static void TrapsForSignals(int sig)
|
||||
{
|
||||
@@ -246,7 +241,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
|
||||
// create a function blocker and set it up
|
||||
cmLoadedCommand* f = new cmLoadedCommand();
|
||||
(*initFunction)(&f->info);
|
||||
this->Makefile->GetState()->AddCommand(f);
|
||||
this->Makefile->GetState()->AddScriptedCommand(args[0], f);
|
||||
return true;
|
||||
}
|
||||
this->SetError("Attempt to load command failed. "
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmLoadCommandCommand; }
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
std::string GetName() const CM_OVERRIDE { return "load_command"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,11 +21,6 @@ public:
|
||||
///! clean up any memory allocated by the macro
|
||||
~cmMacroHelperCommand() CM_OVERRIDE {}
|
||||
|
||||
/**
|
||||
* This determines if the command is defined in a cmake script.
|
||||
*/
|
||||
bool IsUserDefined() const CM_OVERRIDE { return true; }
|
||||
|
||||
/**
|
||||
* This is a virtual constructor for the command.
|
||||
*/
|
||||
@@ -53,11 +48,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return this->Args[0]; }
|
||||
|
||||
std::vector<std::string> Args;
|
||||
std::vector<cmListFileFunction> Functions;
|
||||
cmPolicies::PolicyMap Policies;
|
||||
@@ -184,10 +174,7 @@ bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
|
||||
f->Functions = this->Functions;
|
||||
f->FilePath = this->GetStartingContext().FilePath;
|
||||
mf.RecordPolicies(f->Policies);
|
||||
std::string newName = "_" + this->Args[0];
|
||||
mf.GetState()->RenameCommand(this->Args[0], newName);
|
||||
mf.GetState()->AddCommand(f);
|
||||
|
||||
mf.GetState()->AddScriptedCommand(this->Args[0], f);
|
||||
// remove the function blocker now that the macro is defined
|
||||
mf.RemoveFunctionBlocker(this, lff);
|
||||
return true;
|
||||
|
||||
@@ -44,11 +44,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "macro"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,11 +35,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "make_directory"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "mark_as_advanced"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,11 +28,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "math"; }
|
||||
|
||||
protected:
|
||||
bool HandleExprCommand(std::vector<std::string> const& args);
|
||||
};
|
||||
|
||||
@@ -30,11 +30,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "message"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "option"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,6 @@ public:
|
||||
cmCommand* Clone() CM_OVERRIDE { return new cmOutputRequiredFilesCommand; }
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
std::string GetName() const CM_OVERRIDE { return "output_required_files"; }
|
||||
|
||||
void ListDependencies(cmDependInformation const* info, FILE* fout,
|
||||
std::set<cmDependInformation const*>* visited);
|
||||
|
||||
@@ -29,11 +29,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "cmake_parse_arguments"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,11 +34,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "project"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,11 +32,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "qt_wrap_cpp"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "qt_wrap_ui"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "remove"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "remove_definitions"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "return"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "separate_arguments"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "set"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,14 +28,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "set_directory_properties";
|
||||
}
|
||||
|
||||
/**
|
||||
* Static entry point for use by other commands
|
||||
*/
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "set_property"; }
|
||||
|
||||
private:
|
||||
std::set<std::string> Names;
|
||||
std::string PropertyName;
|
||||
|
||||
@@ -28,14 +28,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE
|
||||
{
|
||||
return "set_source_files_properties";
|
||||
}
|
||||
|
||||
static bool RunCommand(cmMakefile* mf,
|
||||
std::vector<std::string>::const_iterator filebeg,
|
||||
std::vector<std::string>::const_iterator fileend,
|
||||
|
||||
@@ -25,11 +25,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "set_target_properties"; }
|
||||
|
||||
/**
|
||||
* Used by this command and cmSetPropertiesCommand
|
||||
*/
|
||||
|
||||
@@ -25,11 +25,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; }
|
||||
|
||||
static bool SetOneTest(const std::string& tname,
|
||||
std::vector<std::string>& propertyPairs,
|
||||
cmMakefile* mf, std::string& errors);
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "site_name"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "source_group"; }
|
||||
|
||||
private:
|
||||
bool processTree(const std::vector<std::string>& args,
|
||||
std::string& errorMsg);
|
||||
|
||||
+67
-56
@@ -12,10 +12,12 @@
|
||||
#include "cmCacheManager.h"
|
||||
#include "cmCommand.h"
|
||||
#include "cmDefinitions.h"
|
||||
#include "cmDisallowedCommand.h"
|
||||
#include "cmListFileCache.h"
|
||||
#include "cmStatePrivate.h"
|
||||
#include "cmStateSnapshot.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmUnexpectedCommand.h"
|
||||
#include "cmake.h"
|
||||
|
||||
cmState::cmState()
|
||||
@@ -34,7 +36,8 @@ cmState::cmState()
|
||||
cmState::~cmState()
|
||||
{
|
||||
delete this->CacheManager;
|
||||
cmDeleteAll(this->Commands);
|
||||
cmDeleteAll(this->BuiltinCommands);
|
||||
cmDeleteAll(this->ScriptedCommands);
|
||||
}
|
||||
|
||||
const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType)
|
||||
@@ -375,84 +378,92 @@ void cmState::SetIsGeneratorMultiConfig(bool b)
|
||||
this->IsGeneratorMultiConfig = b;
|
||||
}
|
||||
|
||||
void cmState::RenameCommand(std::string const& oldName,
|
||||
std::string const& newName)
|
||||
void cmState::AddBuiltinCommand(std::string const& name, cmCommand* command)
|
||||
{
|
||||
// if the command already exists, free the old one
|
||||
std::string sOldName = cmSystemTools::LowerCase(oldName);
|
||||
std::string sNewName = cmSystemTools::LowerCase(newName);
|
||||
std::map<std::string, cmCommand*>::iterator pos =
|
||||
this->Commands.find(sOldName);
|
||||
if (pos == this->Commands.end()) {
|
||||
return;
|
||||
}
|
||||
cmCommand* cmd = pos->second;
|
||||
|
||||
pos = this->Commands.find(sNewName);
|
||||
if (pos != this->Commands.end()) {
|
||||
delete pos->second;
|
||||
this->Commands.erase(pos);
|
||||
}
|
||||
this->Commands.insert(std::make_pair(sNewName, cmd));
|
||||
pos = this->Commands.find(sOldName);
|
||||
this->Commands.erase(pos);
|
||||
assert(name == cmSystemTools::LowerCase(name));
|
||||
assert(this->BuiltinCommands.find(name) == this->BuiltinCommands.end());
|
||||
this->BuiltinCommands.insert(std::make_pair(name, command));
|
||||
}
|
||||
|
||||
void cmState::AddCommand(cmCommand* command)
|
||||
void cmState::AddDisallowedCommand(std::string const& name, cmCommand* command,
|
||||
cmPolicies::PolicyID policy,
|
||||
const char* message)
|
||||
{
|
||||
std::string name = cmSystemTools::LowerCase(command->GetName());
|
||||
// if the command already exists, free the old one
|
||||
std::map<std::string, cmCommand*>::iterator pos = this->Commands.find(name);
|
||||
if (pos != this->Commands.end()) {
|
||||
delete pos->second;
|
||||
this->Commands.erase(pos);
|
||||
this->AddBuiltinCommand(name,
|
||||
new cmDisallowedCommand(command, policy, message));
|
||||
}
|
||||
|
||||
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
|
||||
{
|
||||
this->AddBuiltinCommand(name, new cmUnexpectedCommand(name, error));
|
||||
}
|
||||
|
||||
void cmState::AddScriptedCommand(std::string const& name, cmCommand* command)
|
||||
{
|
||||
std::string sName = cmSystemTools::LowerCase(name);
|
||||
|
||||
// if the command already exists, give a new name to the old command.
|
||||
if (cmCommand* oldCmd = this->GetCommand(sName)) {
|
||||
std::string const newName = "_" + sName;
|
||||
std::map<std::string, cmCommand*>::iterator pos =
|
||||
this->ScriptedCommands.find(newName);
|
||||
if (pos != this->ScriptedCommands.end()) {
|
||||
delete pos->second;
|
||||
this->ScriptedCommands.erase(pos);
|
||||
}
|
||||
this->ScriptedCommands.insert(std::make_pair(newName, oldCmd->Clone()));
|
||||
}
|
||||
this->Commands.insert(std::make_pair(name, command));
|
||||
|
||||
// if the command already exists, free the old one
|
||||
std::map<std::string, cmCommand*>::iterator pos =
|
||||
this->ScriptedCommands.find(sName);
|
||||
if (pos != this->ScriptedCommands.end()) {
|
||||
delete pos->second;
|
||||
this->ScriptedCommands.erase(pos);
|
||||
}
|
||||
this->ScriptedCommands.insert(std::make_pair(sName, command));
|
||||
}
|
||||
|
||||
cmCommand* cmState::GetCommand(std::string const& name) const
|
||||
{
|
||||
cmCommand* command = CM_NULLPTR;
|
||||
std::string sName = cmSystemTools::LowerCase(name);
|
||||
std::map<std::string, cmCommand*>::const_iterator pos =
|
||||
this->Commands.find(sName);
|
||||
if (pos != this->Commands.end()) {
|
||||
command = (*pos).second;
|
||||
std::map<std::string, cmCommand*>::const_iterator pos;
|
||||
pos = this->ScriptedCommands.find(sName);
|
||||
if (pos != this->ScriptedCommands.end()) {
|
||||
return pos->second;
|
||||
}
|
||||
return command;
|
||||
pos = this->BuiltinCommands.find(sName);
|
||||
if (pos != this->BuiltinCommands.end()) {
|
||||
return pos->second;
|
||||
}
|
||||
return CM_NULLPTR;
|
||||
}
|
||||
|
||||
std::vector<std::string> cmState::GetCommandNames() const
|
||||
{
|
||||
std::vector<std::string> commandNames;
|
||||
commandNames.reserve(this->Commands.size());
|
||||
std::map<std::string, cmCommand*>::const_iterator cmds =
|
||||
this->Commands.begin();
|
||||
for (; cmds != this->Commands.end(); ++cmds) {
|
||||
commandNames.reserve(this->BuiltinCommands.size() +
|
||||
this->ScriptedCommands.size());
|
||||
for (std::map<std::string, cmCommand*>::const_iterator cmds =
|
||||
this->BuiltinCommands.begin();
|
||||
cmds != this->BuiltinCommands.end(); ++cmds) {
|
||||
commandNames.push_back(cmds->first);
|
||||
}
|
||||
for (std::map<std::string, cmCommand*>::const_iterator cmds =
|
||||
this->ScriptedCommands.begin();
|
||||
cmds != this->ScriptedCommands.end(); ++cmds) {
|
||||
commandNames.push_back(cmds->first);
|
||||
}
|
||||
std::sort(commandNames.begin(), commandNames.end());
|
||||
commandNames.erase(std::unique(commandNames.begin(), commandNames.end()),
|
||||
commandNames.end());
|
||||
return commandNames;
|
||||
}
|
||||
|
||||
void cmState::RemoveUserDefinedCommands()
|
||||
{
|
||||
std::vector<cmCommand*> renamedCommands;
|
||||
for (std::map<std::string, cmCommand*>::iterator j = this->Commands.begin();
|
||||
j != this->Commands.end();) {
|
||||
if (j->second->IsUserDefined()) {
|
||||
delete j->second;
|
||||
this->Commands.erase(j++);
|
||||
} else if (j->first != j->second->GetName()) {
|
||||
renamedCommands.push_back(j->second);
|
||||
this->Commands.erase(j++);
|
||||
} else {
|
||||
++j;
|
||||
}
|
||||
}
|
||||
for (std::vector<cmCommand*>::const_iterator it = renamedCommands.begin();
|
||||
it != renamedCommands.end(); ++it) {
|
||||
this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it;
|
||||
}
|
||||
cmDeleteAll(this->ScriptedCommands);
|
||||
this->ScriptedCommands.clear();
|
||||
}
|
||||
|
||||
void cmState::SetGlobalProperty(const std::string& prop, const char* value)
|
||||
|
||||
+8
-3
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "cmDefinitions.h"
|
||||
#include "cmLinkedTree.h"
|
||||
#include "cmPolicies.h"
|
||||
#include "cmProperty.h"
|
||||
#include "cmPropertyDefinitionMap.h"
|
||||
#include "cmPropertyMap.h"
|
||||
@@ -120,8 +121,11 @@ public:
|
||||
void SetIsGeneratorMultiConfig(bool b);
|
||||
|
||||
cmCommand* GetCommand(std::string const& name) const;
|
||||
void AddCommand(cmCommand* command);
|
||||
void RenameCommand(std::string const& oldName, std::string const& newName);
|
||||
void AddBuiltinCommand(std::string const& name, cmCommand* command);
|
||||
void AddDisallowedCommand(std::string const& name, cmCommand* command,
|
||||
cmPolicies::PolicyID policy, const char* message);
|
||||
void AddUnexpectedCommand(std::string const& name, const char* error);
|
||||
void AddScriptedCommand(std::string const& name, cmCommand* command);
|
||||
void RemoveUserDefinedCommands();
|
||||
std::vector<std::string> GetCommandNames() const;
|
||||
|
||||
@@ -160,7 +164,8 @@ private:
|
||||
|
||||
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
|
||||
std::vector<std::string> EnabledLanguages;
|
||||
std::map<std::string, cmCommand*> Commands;
|
||||
std::map<std::string, cmCommand*> BuiltinCommands;
|
||||
std::map<std::string, cmCommand*> ScriptedCommands;
|
||||
cmPropertyMap GlobalProperties;
|
||||
cmCacheManager* CacheManager;
|
||||
|
||||
|
||||
@@ -31,11 +31,6 @@ public:
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "string"; }
|
||||
|
||||
protected:
|
||||
bool HandleConfigureCommand(std::vector<std::string> const& args);
|
||||
bool HandleAsciiCommand(std::vector<std::string> const& args);
|
||||
|
||||
@@ -33,11 +33,6 @@ public:
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) CM_OVERRIDE;
|
||||
|
||||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
std::string GetName() const CM_OVERRIDE { return "subdirs"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user