summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-21 17:25:13 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-21 17:36:52 (GMT)
commit94c1e4fdb35c01ef5ad57ed3284b20d8d7fc3496 (patch)
treeb2dd5a73b5839d50fa6f5fb0af2c356b69815db5 /Source
parent3c5d52579b271e99475873cec953a1ecccbea585 (diff)
downloadCMake-94c1e4fdb35c01ef5ad57ed3284b20d8d7fc3496.zip
CMake-94c1e4fdb35c01ef5ad57ed3284b20d8d7fc3496.tar.gz
CMake-94c1e4fdb35c01ef5ad57ed3284b20d8d7fc3496.tar.bz2
cmake_language: Rename command from cmake_command
Also rename the `INVOKE` signature to `CALL`. Fixes: #20732
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Source/cmCMakeLanguageCommand.cxx (renamed from Source/cmCMakeCommand.cxx)16
-rw-r--r--Source/cmCMakeLanguageCommand.h (renamed from Source/cmCMakeCommand.h)8
-rw-r--r--Source/cmCommands.cxx4
4 files changed, 16 insertions, 16 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 6d585ee..22d8032 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -488,10 +488,10 @@ set(SRCS
cmBuildCommand.h
cmBuildNameCommand.cxx
cmBuildNameCommand.h
- cmCMakeCommand.cxx
- cmCMakeCommand.h
cmCMakeHostSystemInformationCommand.cxx
cmCMakeHostSystemInformationCommand.h
+ cmCMakeLanguageCommand.cxx
+ cmCMakeLanguageCommand.h
cmCMakeMinimumRequired.cxx
cmCMakeMinimumRequired.h
cmCMakePolicyCommand.cxx
diff --git a/Source/cmCMakeCommand.cxx b/Source/cmCMakeLanguageCommand.cxx
index 23bc0ea..66857be 100644
--- a/Source/cmCMakeCommand.cxx
+++ b/Source/cmCMakeLanguageCommand.cxx
@@ -1,6 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmCMakeCommand.h"
+#include "cmCMakeLanguageCommand.h"
#include <algorithm>
#include <cstddef>
@@ -13,8 +13,8 @@
#include "cmRange.h"
#include "cmStringAlgorithms.h"
-bool cmCMakeCommand(std::vector<cmListFileArgument> const& args,
- cmExecutionStatus& status)
+bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
+ cmExecutionStatus& status)
{
if (args.empty()) {
status.SetError("called with incorrect number of arguments");
@@ -36,7 +36,7 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args,
return false;
}
- if (dispatchExpandedArgs[0] == "INVOKE") {
+ if (dispatchExpandedArgs[0] == "CALL") {
if ((args.size() == 1 && dispatchExpandedArgs.size() != 2) ||
dispatchExpandedArgs.size() > 2) {
status.SetError("called with incorrect number of arguments");
@@ -44,7 +44,7 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args,
}
// First argument is the name of the function to call
- std::string invokeCommand;
+ std::string callCommand;
size_t startArg;
if (dispatchExpandedArgs.size() == 1) {
std::vector<std::string> functionExpandedArg;
@@ -57,15 +57,15 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args,
return false;
}
- invokeCommand = functionExpandedArg[0];
+ callCommand = functionExpandedArg[0];
startArg = 2;
} else {
- invokeCommand = dispatchExpandedArgs[1];
+ callCommand = dispatchExpandedArgs[1];
startArg = 1;
}
cmListFileFunction func;
- func.Name = invokeCommand;
+ func.Name = callCommand;
func.Line = context.Line;
// The rest of the arguments are passed to the function call above
diff --git a/Source/cmCMakeCommand.h b/Source/cmCMakeLanguageCommand.h
index 7dbecff..7306515 100644
--- a/Source/cmCMakeCommand.h
+++ b/Source/cmCMakeLanguageCommand.h
@@ -1,7 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmCMakeCommand_h
-#define cmCMakeCommand_h
+#ifndef cmCMakeLanguageCommand_h
+#define cmCMakeLanguageCommand_h
#include "cmConfigure.h" // IWYU pragma: keep
@@ -14,7 +14,7 @@ struct cmListFileArgument;
* \brief Calls a scripted or build-in command
*
*/
-bool cmCMakeCommand(std::vector<cmListFileArgument> const& args,
- cmExecutionStatus& status);
+bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args,
+ cmExecutionStatus& status);
#endif
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 28b4267..c94f128 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -91,8 +91,8 @@
# include "cmAddLinkOptionsCommand.h"
# include "cmAuxSourceDirectoryCommand.h"
# include "cmBuildNameCommand.h"
-# include "cmCMakeCommand.h"
# include "cmCMakeHostSystemInformationCommand.h"
+# include "cmCMakeLanguageCommand.h"
# include "cmExportCommand.h"
# include "cmExportLibraryDependenciesCommand.h"
# include "cmFLTKWrapUICommand.h"
@@ -197,9 +197,9 @@ void GetScriptingCommands(cmState* state)
"match the opening WHILE command.");
#if !defined(CMAKE_BOOTSTRAP)
- state->AddBuiltinCommand("cmake_command", cmCMakeCommand);
state->AddBuiltinCommand("cmake_host_system_information",
cmCMakeHostSystemInformationCommand);
+ state->AddBuiltinCommand("cmake_language", cmCMakeLanguageCommand);
state->AddBuiltinCommand("load_cache", cmLoadCacheCommand);
state->AddBuiltinCommand("remove", cmRemoveCommand);
state->AddBuiltinCommand("variable_watch", cmVariableWatchCommand);