You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
3.2 KiB

  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmExecutablesCommand_h
  14. #define cmExecutablesCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmExecutablesCommand
  17. * \brief Defines a list of executables to build.
  18. *
  19. * cmExecutablesCommand defines a list of executable (i.e., test)
  20. * programs to create.
  21. */
  22. class cmAddExecutableCommand : public cmCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmAddExecutableCommand;
  31. }
  32. /**
  33. * This is called when the command is first encountered in
  34. * the CMakeLists.txt file.
  35. */
  36. virtual bool InitialPass(std::vector<std::string> const& args);
  37. /**
  38. * The name of the command as specified in CMakeList.txt.
  39. */
  40. virtual const char* GetName() { return "add_executable";}
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation()
  45. {
  46. return
  47. "Add an executable to the project using the specified source files.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " add_executable(exename [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]\n"
  56. " source1 source2 ... sourceN)\n"
  57. "This command adds an executable target to the current directory. "
  58. "The executable will be built from the list of source files "
  59. "specified.\n"
  60. "After specifying the executable name, WIN32 and/or MACOSX_BUNDLE can "
  61. "be specified. WIN32 indicates that the executable (when compiled on "
  62. "windows) is a windows app (using WinMain) not a console app "
  63. "(using main). The variable CMAKE_MFC_FLAG be used if the windows app "
  64. "uses MFC. This variable can be set to the following values:\n"
  65. " 0: Use Standard Windows Libraries\n"
  66. " 1: Use MFC in a Static Library \n"
  67. " 2: Use MFC in a Shared DLL \n"
  68. "MACOSX_BUNDLE indicates that when build on Mac OSX, executable should "
  69. "be in the bundle form. The MACOSX_BUNDLE also allows several "
  70. "variables to be specified:\n"
  71. " MACOSX_BUNDLE_INFO_STRING\n"
  72. " MACOSX_BUNDLE_ICON_FILE\n"
  73. " MACOSX_BUNDLE_GUI_IDENTIFIER\n"
  74. " MACOSX_BUNDLE_LONG_VERSION_STRING\n"
  75. " MACOSX_BUNDLE_BUNDLE_NAME\n"
  76. " MACOSX_BUNDLE_SHORT_VERSION_STRING\n"
  77. " MACOSX_BUNDLE_BUNDLE_VERSION\n"
  78. " MACOSX_BUNDLE_COPYRIGHT\n"
  79. "If EXCLUDE_FROM_ALL is given the target will not be built by default. "
  80. "It will be built only if the user explicitly builds the target or "
  81. "another target that requires the target depends on it."
  82. ;
  83. }
  84. cmTypeMacro(cmAddExecutableCommand, cmCommand);
  85. };
  86. #endif