cmAddExecutableCommand.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmExecutablesCommand
  18. * \brief Defines a list of executables to build.
  19. *
  20. * cmExecutablesCommand defines a list of executable (i.e., test)
  21. * programs to create.
  22. */
  23. class cmAddExecutableCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmAddExecutableCommand;
  32. }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool InitialPass(std::vector<std::string> const& args);
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() { return "ADD_EXECUTABLE";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Add an executable to the project that uses the specified srclists";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. "ADD_EXECUTABLE(exename srclist srclist srclist ...)\n"
  56. "ADD_EXECUTABLE(exename WIN32 srclist srclist srclist ...)"
  57. "This command adds an executable target to the current directory. "
  58. "The executable will be built from the source files / source lists "
  59. "specified. The second argument to this command can be WIN32 "
  60. "which indicates that the executable (when compiled on windows) "
  61. "is a windows app (using WinMain)not a console app (using main).";
  62. }
  63. cmTypeMacro(cmAddExecutableCommand, cmCommand);
  64. };
  65. #endif