diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-11-27 19:38:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-29 18:53:29 (GMT) |
commit | 67303794f0bd36912cd9e7e7d0402c3c6fc85a11 (patch) | |
tree | fd7c64727e890eb3e9c57c81c0e8775a297cefa9 /Source/cmCommands.cxx | |
parent | d23a0196844f066047aa6942b69c6e591462df38 (diff) | |
download | CMake-67303794f0bd36912cd9e7e7d0402c3c6fc85a11.zip CMake-67303794f0bd36912cd9e7e7d0402c3c6fc85a11.tar.gz CMake-67303794f0bd36912cd9e7e7d0402c3c6fc85a11.tar.bz2 |
Combine all unexpected commands to a single class
Diffstat (limited to 'Source/cmCommands.cxx')
-rw-r--r-- | Source/cmCommands.cxx | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 103e72c..4c5b093 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -18,14 +18,8 @@ #include "cmContinueCommand.h" #include "cmCreateTestSourceList.h" #include "cmDefinePropertyCommand.h" -#include "cmElseCommand.h" #include "cmEnableLanguageCommand.h" #include "cmEnableTestingCommand.h" -#include "cmEndForEachCommand.h" -#include "cmEndFunctionCommand.h" -#include "cmEndIfCommand.h" -#include "cmEndMacroCommand.h" -#include "cmEndWhileCommand.h" #include "cmExecProgramCommand.h" #include "cmExecuteProcessCommand.h" #include "cmFileCommand.h" @@ -74,6 +68,7 @@ #include "cmTargetLinkLibrariesCommand.h" #include "cmTryCompileCommand.h" #include "cmTryRunCommand.h" +#include "cmUnexpectedCommand.h" #include "cmUnsetCommand.h" #include "cmWhileCommand.h" @@ -82,7 +77,6 @@ #include "cmAuxSourceDirectoryCommand.h" #include "cmBuildNameCommand.h" #include "cmCMakeHostSystemInformationCommand.h" -#include "cmElseIfCommand.h" #include "cmExportCommand.h" #include "cmExportLibraryDependenciesCommand.h" #include "cmFLTKWrapUICommand.h" @@ -130,14 +124,8 @@ std::vector<cmCommand*> GetPredefinedCommands() commands.push_back(new cmContinueCommand); commands.push_back(new cmCreateTestSourceList); commands.push_back(new cmDefinePropertyCommand); - commands.push_back(new cmElseCommand); commands.push_back(new cmEnableLanguageCommand); commands.push_back(new cmEnableTestingCommand); - commands.push_back(new cmEndForEachCommand); - commands.push_back(new cmEndFunctionCommand); - commands.push_back(new cmEndIfCommand); - commands.push_back(new cmEndMacroCommand); - commands.push_back(new cmEndWhileCommand); commands.push_back(new cmExecProgramCommand); commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmFileCommand); @@ -189,12 +177,39 @@ std::vector<cmCommand*> GetPredefinedCommands() commands.push_back(new cmUnsetCommand); commands.push_back(new cmWhileCommand); + commands.push_back(new cmUnexpectedCommand( + "else", "An ELSE command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command.")); + commands.push_back(new cmUnexpectedCommand( + "elseif", "An ELSEIF command was found outside of a proper " + "IF ENDIF structure.")); + commands.push_back(new cmUnexpectedCommand( + "endforeach", "An ENDFOREACH command was found outside of a proper " + "FOREACH ENDFOREACH structure. Or its arguments did " + "not match the opening FOREACH command.")); + commands.push_back(new cmUnexpectedCommand( + "endfunction", "An ENDFUNCTION command was found outside of a proper " + "FUNCTION ENDFUNCTION structure. Or its arguments did not " + "match the opening FUNCTION command.")); + commands.push_back(new cmUnexpectedCommand( + "endif", "An ENDIF command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command.")); + commands.push_back(new cmUnexpectedCommand( + "endmacro", "An ENDMACRO command was found outside of a proper " + "MACRO ENDMACRO structure. Or its arguments did not " + "match the opening MACRO command.")); + commands.push_back(new cmUnexpectedCommand( + "endwhile", "An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command.")); + #if defined(CMAKE_BUILD_WITH_CMAKE) commands.push_back(new cmAddCompileOptionsCommand); commands.push_back(new cmAuxSourceDirectoryCommand); commands.push_back(new cmBuildNameCommand); commands.push_back(new cmCMakeHostSystemInformationCommand); - commands.push_back(new cmElseIfCommand); commands.push_back(new cmExportCommand); commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmFLTKWrapUICommand); |