cmUtilitySourceCommand.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 cmUtilitySourceCommand_h
  14. #define cmUtilitySourceCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmUtilitySourceCommand
  18. * \brief A command to setup a cache entry with the location of a third-party
  19. * utility's source.
  20. *
  21. * cmUtilitySourceCommand is used when a third-party utility's source is
  22. * included in the project's source tree. It specifies the location of
  23. * the executable's source, and any files that may be needed to confirm the
  24. * identity of the source.
  25. */
  26. class cmUtilitySourceCommand : public cmCommand
  27. {
  28. public:
  29. /**
  30. * This is a virtual constructor for the command.
  31. */
  32. virtual cmCommand* Clone()
  33. {
  34. return new cmUtilitySourceCommand;
  35. }
  36. /**
  37. * This is called when the command is first encountered in
  38. * the CMakeLists.txt file.
  39. */
  40. virtual bool InitialPass(std::vector<std::string> const& args);
  41. /**
  42. * This determines if the command gets propagated down
  43. * to makefiles located in subdirectories.
  44. */
  45. virtual bool IsInherited() { return true; }
  46. /**
  47. * The name of the command as specified in CMakeList.txt.
  48. */
  49. virtual const char* GetName() { return "UTILITY_SOURCE";}
  50. /**
  51. * Succinct documentation.
  52. */
  53. virtual const char* GetTerseDocumentation()
  54. {
  55. return "Specify the source tree of a third-party utility.";
  56. }
  57. /**
  58. * More documentation.
  59. */
  60. virtual const char* GetFullDocumentation()
  61. {
  62. return
  63. " UTILITY_SOURCE(cache_entry executable_name\n"
  64. " path_to_source [file1 file2 ...])\n"
  65. "When a third-party utility's source is included in the distribution, "
  66. "this command specifies its location and name. The cache entry will "
  67. "not be set unless the path_to_source and all listed files exist. It "
  68. "is assumed that the source tree of the utility will have been built "
  69. "before it is needed.";
  70. }
  71. cmTypeMacro(cmUtilitySourceCommand, cmCommand);
  72. };
  73. #endif