cmUtilitySourceCommand.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 path_to_source [file1 file2 ...])\n"
  64. "When a third-party utility's source is included in the distribution,\n"
  65. "this command specifies its location and name. The cache entry will\n"
  66. "not be set unless the path_to_source and all listed files exist. It\n"
  67. "is assumed that the source tree of the utility will have been built\n"
  68. "before it is needed.";
  69. }
  70. cmTypeMacro(cmUtilitySourceCommand, cmCommand);
  71. };
  72. #endif