cmCommands.cxx 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCommands.h"
  4. #include "cmAddCustomCommandCommand.h"
  5. #include "cmAddCustomTargetCommand.h"
  6. #include "cmAddDefinitionsCommand.h"
  7. #include "cmAddDependenciesCommand.h"
  8. #include "cmAddExecutableCommand.h"
  9. #include "cmAddLibraryCommand.h"
  10. #include "cmAddSubDirectoryCommand.h"
  11. #include "cmAddTestCommand.h"
  12. #include "cmBreakCommand.h"
  13. #include "cmBuildCommand.h"
  14. #include "cmCMakeMinimumRequired.h"
  15. #include "cmCMakePolicyCommand.h"
  16. #include "cmConfigureFileCommand.h"
  17. #include "cmContinueCommand.h"
  18. #include "cmCreateTestSourceList.h"
  19. #include "cmDefinePropertyCommand.h"
  20. #include "cmEnableLanguageCommand.h"
  21. #include "cmEnableTestingCommand.h"
  22. #include "cmExecProgramCommand.h"
  23. #include "cmExecuteProcessCommand.h"
  24. #include "cmFileCommand.h"
  25. #include "cmFindFileCommand.h"
  26. #include "cmFindLibraryCommand.h"
  27. #include "cmFindPackageCommand.h"
  28. #include "cmFindPathCommand.h"
  29. #include "cmFindProgramCommand.h"
  30. #include "cmForEachCommand.h"
  31. #include "cmFunctionCommand.h"
  32. #include "cmGetCMakePropertyCommand.h"
  33. #include "cmGetDirectoryPropertyCommand.h"
  34. #include "cmGetFilenameComponentCommand.h"
  35. #include "cmGetPropertyCommand.h"
  36. #include "cmGetSourceFilePropertyCommand.h"
  37. #include "cmGetTargetPropertyCommand.h"
  38. #include "cmGetTestPropertyCommand.h"
  39. #include "cmIfCommand.h"
  40. #include "cmIncludeCommand.h"
  41. #include "cmIncludeDirectoryCommand.h"
  42. #include "cmIncludeRegularExpressionCommand.h"
  43. #include "cmInstallCommand.h"
  44. #include "cmInstallFilesCommand.h"
  45. #include "cmInstallTargetsCommand.h"
  46. #include "cmLinkDirectoriesCommand.h"
  47. #include "cmListCommand.h"
  48. #include "cmMacroCommand.h"
  49. #include "cmMakeDirectoryCommand.h"
  50. #include "cmMarkAsAdvancedCommand.h"
  51. #include "cmMathCommand.h"
  52. #include "cmMessageCommand.h"
  53. #include "cmOptionCommand.h"
  54. #include "cmParseArgumentsCommand.h"
  55. #include "cmProjectCommand.h"
  56. #include "cmReturnCommand.h"
  57. #include "cmSeparateArgumentsCommand.h"
  58. #include "cmSetCommand.h"
  59. #include "cmSetDirectoryPropertiesCommand.h"
  60. #include "cmSetPropertyCommand.h"
  61. #include "cmSetSourceFilesPropertiesCommand.h"
  62. #include "cmSetTargetPropertiesCommand.h"
  63. #include "cmSetTestsPropertiesCommand.h"
  64. #include "cmSiteNameCommand.h"
  65. #include "cmStringCommand.h"
  66. #include "cmSubdirCommand.h"
  67. #include "cmTargetLinkLibrariesCommand.h"
  68. #include "cmTryCompileCommand.h"
  69. #include "cmTryRunCommand.h"
  70. #include "cmUnexpectedCommand.h"
  71. #include "cmUnsetCommand.h"
  72. #include "cmWhileCommand.h"
  73. #if defined(CMAKE_BUILD_WITH_CMAKE)
  74. #include "cmAddCompileOptionsCommand.h"
  75. #include "cmAuxSourceDirectoryCommand.h"
  76. #include "cmBuildNameCommand.h"
  77. #include "cmCMakeHostSystemInformationCommand.h"
  78. #include "cmExportCommand.h"
  79. #include "cmExportLibraryDependenciesCommand.h"
  80. #include "cmFLTKWrapUICommand.h"
  81. #include "cmIncludeExternalMSProjectCommand.h"
  82. #include "cmInstallProgramsCommand.h"
  83. #include "cmLinkLibrariesCommand.h"
  84. #include "cmLoadCacheCommand.h"
  85. #include "cmLoadCommandCommand.h"
  86. #include "cmOutputRequiredFilesCommand.h"
  87. #include "cmQTWrapCPPCommand.h"
  88. #include "cmQTWrapUICommand.h"
  89. #include "cmRemoveCommand.h"
  90. #include "cmRemoveDefinitionsCommand.h"
  91. #include "cmSourceGroupCommand.h"
  92. #include "cmSubdirDependsCommand.h"
  93. #include "cmTargetCompileDefinitionsCommand.h"
  94. #include "cmTargetCompileFeaturesCommand.h"
  95. #include "cmTargetCompileOptionsCommand.h"
  96. #include "cmTargetIncludeDirectoriesCommand.h"
  97. #include "cmTargetSourcesCommand.h"
  98. #include "cmUseMangledMesaCommand.h"
  99. #include "cmUtilitySourceCommand.h"
  100. #include "cmVariableRequiresCommand.h"
  101. #include "cmVariableWatchCommand.h"
  102. #include "cmWriteFileCommand.h"
  103. #endif
  104. std::vector<cmCommand*> GetPredefinedCommands()
  105. {
  106. std::vector<cmCommand*> commands;
  107. commands.push_back(new cmAddCustomCommandCommand);
  108. commands.push_back(new cmAddCustomTargetCommand);
  109. commands.push_back(new cmAddDefinitionsCommand);
  110. commands.push_back(new cmAddDependenciesCommand);
  111. commands.push_back(new cmAddExecutableCommand);
  112. commands.push_back(new cmAddLibraryCommand);
  113. commands.push_back(new cmAddSubDirectoryCommand);
  114. commands.push_back(new cmAddTestCommand);
  115. commands.push_back(new cmBreakCommand);
  116. commands.push_back(new cmBuildCommand);
  117. commands.push_back(new cmCMakeMinimumRequired);
  118. commands.push_back(new cmCMakePolicyCommand);
  119. commands.push_back(new cmConfigureFileCommand);
  120. commands.push_back(new cmContinueCommand);
  121. commands.push_back(new cmCreateTestSourceList);
  122. commands.push_back(new cmDefinePropertyCommand);
  123. commands.push_back(new cmEnableLanguageCommand);
  124. commands.push_back(new cmEnableTestingCommand);
  125. commands.push_back(new cmExecProgramCommand);
  126. commands.push_back(new cmExecuteProcessCommand);
  127. commands.push_back(new cmFileCommand);
  128. commands.push_back(new cmFindFileCommand);
  129. commands.push_back(new cmFindLibraryCommand);
  130. commands.push_back(new cmFindPackageCommand);
  131. commands.push_back(new cmFindPathCommand);
  132. commands.push_back(new cmFindProgramCommand);
  133. commands.push_back(new cmForEachCommand);
  134. commands.push_back(new cmFunctionCommand);
  135. commands.push_back(new cmGetCMakePropertyCommand);
  136. commands.push_back(new cmGetDirectoryPropertyCommand);
  137. commands.push_back(new cmGetFilenameComponentCommand);
  138. commands.push_back(new cmGetPropertyCommand);
  139. commands.push_back(new cmGetSourceFilePropertyCommand);
  140. commands.push_back(new cmGetTargetPropertyCommand);
  141. commands.push_back(new cmGetTestPropertyCommand);
  142. commands.push_back(new cmIfCommand);
  143. commands.push_back(new cmIncludeCommand);
  144. commands.push_back(new cmIncludeDirectoryCommand);
  145. commands.push_back(new cmIncludeRegularExpressionCommand);
  146. commands.push_back(new cmInstallCommand);
  147. commands.push_back(new cmInstallFilesCommand);
  148. commands.push_back(new cmInstallTargetsCommand);
  149. commands.push_back(new cmLinkDirectoriesCommand);
  150. commands.push_back(new cmListCommand);
  151. commands.push_back(new cmMacroCommand);
  152. commands.push_back(new cmMakeDirectoryCommand);
  153. commands.push_back(new cmMarkAsAdvancedCommand);
  154. commands.push_back(new cmMathCommand);
  155. commands.push_back(new cmMessageCommand);
  156. commands.push_back(new cmOptionCommand);
  157. commands.push_back(new cmParseArgumentsCommand);
  158. commands.push_back(new cmProjectCommand);
  159. commands.push_back(new cmReturnCommand);
  160. commands.push_back(new cmSeparateArgumentsCommand);
  161. commands.push_back(new cmSetCommand);
  162. commands.push_back(new cmSetDirectoryPropertiesCommand);
  163. commands.push_back(new cmSetPropertyCommand);
  164. commands.push_back(new cmSetSourceFilesPropertiesCommand);
  165. commands.push_back(new cmSetTargetPropertiesCommand);
  166. commands.push_back(new cmSetTestsPropertiesCommand);
  167. commands.push_back(new cmSiteNameCommand);
  168. commands.push_back(new cmStringCommand);
  169. commands.push_back(new cmSubdirCommand);
  170. commands.push_back(new cmTargetLinkLibrariesCommand);
  171. commands.push_back(new cmTryCompileCommand);
  172. commands.push_back(new cmTryRunCommand);
  173. commands.push_back(new cmUnsetCommand);
  174. commands.push_back(new cmWhileCommand);
  175. commands.push_back(new cmUnexpectedCommand(
  176. "else", "An ELSE command was found outside of a proper "
  177. "IF ENDIF structure. Or its arguments did not match "
  178. "the opening IF command."));
  179. commands.push_back(new cmUnexpectedCommand(
  180. "elseif", "An ELSEIF command was found outside of a proper "
  181. "IF ENDIF structure."));
  182. commands.push_back(new cmUnexpectedCommand(
  183. "endforeach", "An ENDFOREACH command was found outside of a proper "
  184. "FOREACH ENDFOREACH structure. Or its arguments did "
  185. "not match the opening FOREACH command."));
  186. commands.push_back(new cmUnexpectedCommand(
  187. "endfunction", "An ENDFUNCTION command was found outside of a proper "
  188. "FUNCTION ENDFUNCTION structure. Or its arguments did not "
  189. "match the opening FUNCTION command."));
  190. commands.push_back(new cmUnexpectedCommand(
  191. "endif", "An ENDIF command was found outside of a proper "
  192. "IF ENDIF structure. Or its arguments did not match "
  193. "the opening IF command."));
  194. commands.push_back(new cmUnexpectedCommand(
  195. "endmacro", "An ENDMACRO command was found outside of a proper "
  196. "MACRO ENDMACRO structure. Or its arguments did not "
  197. "match the opening MACRO command."));
  198. commands.push_back(new cmUnexpectedCommand(
  199. "endwhile", "An ENDWHILE command was found outside of a proper "
  200. "WHILE ENDWHILE structure. Or its arguments did not "
  201. "match the opening WHILE command."));
  202. #if defined(CMAKE_BUILD_WITH_CMAKE)
  203. commands.push_back(new cmAddCompileOptionsCommand);
  204. commands.push_back(new cmAuxSourceDirectoryCommand);
  205. commands.push_back(new cmBuildNameCommand);
  206. commands.push_back(new cmCMakeHostSystemInformationCommand);
  207. commands.push_back(new cmExportCommand);
  208. commands.push_back(new cmExportLibraryDependenciesCommand);
  209. commands.push_back(new cmFLTKWrapUICommand);
  210. commands.push_back(new cmIncludeExternalMSProjectCommand);
  211. commands.push_back(new cmInstallProgramsCommand);
  212. commands.push_back(new cmLinkLibrariesCommand);
  213. commands.push_back(new cmLoadCacheCommand);
  214. commands.push_back(new cmLoadCommandCommand);
  215. commands.push_back(new cmOutputRequiredFilesCommand);
  216. commands.push_back(new cmQTWrapCPPCommand);
  217. commands.push_back(new cmQTWrapUICommand);
  218. commands.push_back(new cmRemoveCommand);
  219. commands.push_back(new cmRemoveDefinitionsCommand);
  220. commands.push_back(new cmSourceGroupCommand);
  221. commands.push_back(new cmSubdirDependsCommand);
  222. commands.push_back(new cmTargetCompileDefinitionsCommand);
  223. commands.push_back(new cmTargetCompileFeaturesCommand);
  224. commands.push_back(new cmTargetCompileOptionsCommand);
  225. commands.push_back(new cmTargetIncludeDirectoriesCommand);
  226. commands.push_back(new cmTargetSourcesCommand);
  227. commands.push_back(new cmUseMangledMesaCommand);
  228. commands.push_back(new cmUtilitySourceCommand);
  229. commands.push_back(new cmVariableRequiresCommand);
  230. commands.push_back(new cmVariableWatchCommand);
  231. commands.push_back(new cmWriteFileCommand);
  232. #endif
  233. return commands;
  234. }