cmCableInstantiateCommand.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmCableInstantiateCommand_h
  12. #define cmCableInstantiateCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCableCommand.h"
  15. /** \class cmCableInstantiateCommand
  16. * \brief Define a command that generates a rule for explicit template
  17. * instantiations.
  18. *
  19. * cmCableInstantiateCommand is used to generate a rule in a CABLE
  20. * configuration file to create explicit template instantiations.
  21. */
  22. class cmCableInstantiateCommand : public cmCableCommand
  23. {
  24. public:
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. return new cmCableInstantiateCommand;
  31. }
  32. /**
  33. * This is called when the command is first encountered in
  34. * the CMakeLists.txt file.
  35. */
  36. virtual bool Invoke(std::vector<std::string>& args);
  37. /**
  38. * This is called after all input commands have been processed.
  39. */
  40. virtual void FinalPass();
  41. /**
  42. * This determines if the command gets propagated down
  43. * to makefiles located in subdirectories.
  44. */
  45. virtual bool IsInherited()
  46. {return true;}
  47. /**
  48. * The name of the command as specified in CMakeList.txt.
  49. */
  50. virtual const char* GetName() { return "CABLE_INSTANTIATE";}
  51. /**
  52. * Succinct documentation.
  53. */
  54. virtual const char* GetTerseDocumentation()
  55. {
  56. return "Define CABLE InstantiationSet.";
  57. }
  58. /**
  59. * More documentation.
  60. */
  61. virtual const char* GetFullDocumentation()
  62. {
  63. return
  64. "CABLE_INSTANTIATE(cable_config_file member1 member2 ...)\n"
  65. "Generates an InstantiationSet in the CABLE configuration. It is\n"
  66. "assumed that all members of the set are explicit instantiations of\n"
  67. "template non-classes (functions, operators, etc).";
  68. }
  69. virtual void WriteConfiguration(std::ostream&) const;
  70. cmTypeMacro(cmCableInstantiateCommand, cmCableCommand);
  71. protected:
  72. typedef std::vector<std::string> Elements;
  73. /**
  74. * The output file to which to write the configuration.
  75. */
  76. cmCableData::OutputFile* m_OutputFile;
  77. /**
  78. * The elements describing the set of instantiations.
  79. */
  80. Elements m_Elements;
  81. };
  82. #endif