cmAddExecutableCommand.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 "Add an executable to the project using the specified source files.";
  47. }
  48. /**
  49. * More documentation.
  50. */
  51. virtual const char* GetFullDocumentation()
  52. {
  53. return
  54. " ADD_EXECUTABLE(exename [WIN32] [MACBUNDLE] source1\n"
  55. " source2 ... sourceN)\n"
  56. "This command adds an executable target to the current directory. "
  57. "The executable will be built from the list of source files "
  58. "specified.\n"
  59. "After specifying the executable name, WIN32 and/or MACBUNDLE can "
  60. "be specified. WIN32 indicates that the executable (when compiled on "
  61. "windows) is a windows app (using WinMain) not a console app (using main). "
  62. "MACBUNDLE indicates that when build on Mac OSX, executable should be in "
  63. "the bundle form. The MACBUNDLE also allows several variables to be specified:\n"
  64. " MACOSX_BUNDLE_INFO_STRING\n"
  65. " MACOSX_BUNDLE_ICON_FILE\n"
  66. " MACOSX_BUNDLE_GUI_IDENTIFIER\n"
  67. " MACOSX_BUNDLE_LONG_VERSION_STRING\n"
  68. " MACOSX_BUNDLE_BUNDLE_NAME\n"
  69. " MACOSX_BUNDLE_SHORT_VERSION_STRING\n"
  70. " MACOSX_BUNDLE_BUNDLE_VERSION\n"
  71. " MACOSX_BUNDLE_COPYRIGHT\n"
  72. ;
  73. }
  74. cmTypeMacro(cmAddExecutableCommand, cmCommand);
  75. };
  76. #endif