cmProjectCommand.h 2.4 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 cmProjectCommand_h
  14. #define cmProjectCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmProjectCommand
  18. * \brief Specify the name for this build project.
  19. *
  20. * cmProjectCommand is used to specify a name for this build project.
  21. * It is defined once per set of CMakeList.txt files (including
  22. * all subdirectories). Currently it just sets the name of the workspace
  23. * file for Microsoft Visual C++
  24. */
  25. class cmProjectCommand : public cmCommand
  26. {
  27. public:
  28. /**
  29. * This is a virtual constructor for the command.
  30. */
  31. virtual cmCommand* Clone()
  32. {
  33. return new cmProjectCommand;
  34. }
  35. /**
  36. * This is called when the command is first encountered in
  37. * the CMakeLists.txt file.
  38. */
  39. virtual bool InitialPass(std::vector<std::string> const& args);
  40. /**
  41. * The name of the command as specified in CMakeList.txt.
  42. */
  43. virtual const char* GetName() {return "PROJECT";}
  44. /**
  45. * This determines if the command gets propagated down
  46. * to makefiles located in subdirectories.
  47. */
  48. virtual bool IsInherited()
  49. {
  50. return true;
  51. }
  52. /**
  53. * Succinct documentation.
  54. */
  55. virtual const char* GetTerseDocumentation()
  56. {
  57. return "Set a name for the entire project.";
  58. }
  59. /**
  60. * More documentation.
  61. */
  62. virtual const char* GetFullDocumentation()
  63. {
  64. return
  65. " PROJECT(projectname [C++] [C] [Java])\n"
  66. "Sets the name of the project. "
  67. "This creates the variables projectname_BINARY_DIR and projectname_SOURCE_DIR. "
  68. "Optionally you can specify which languages your project supports. "
  69. "By default all languages are supported. If you do not have a C++ compiler, but want"
  70. " to build a c program with cmake, then use this option.";
  71. }
  72. cmTypeMacro(cmProjectCommand, cmCommand);
  73. };
  74. #endif