cmITKWrapTclCommand.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 cmITKWrapTclCommand_h
  14. #define cmITKWrapTclCommand_h
  15. #include "cmCommand.h"
  16. class cmDependInformation;
  17. class cmMakeDepend;
  18. /** \class cmITKWrapTclCommand
  19. * \brief Run CABLE to generate Tcl wrappers.
  20. *
  21. * cmITKWrapTclCommand runs CABLE on the specified configuration files
  22. * and combines them into a package on a given target.
  23. */
  24. class cmITKWrapTclCommand : public cmCommand
  25. {
  26. public:
  27. cmITKWrapTclCommand();
  28. ~cmITKWrapTclCommand();
  29. /** This is a virtual constructor for the command. */
  30. virtual cmCommand* Clone() { return new cmITKWrapTclCommand; }
  31. /** This is called when the command is first encountered in
  32. * the CMakeLists.txt file. */
  33. virtual bool InitialPass(std::vector<std::string> const& args);
  34. /** The name of the command as specified in CMakeList.txt. */
  35. virtual const char* GetName() {return "ITK_WRAP_TCL";}
  36. /** Succinct documentation. */
  37. virtual const char* GetTerseDocumentation()
  38. { return "Run CABLE to generate Tcl wrappers."; }
  39. /** More documentation. */
  40. virtual const char* GetFullDocumentation()
  41. {
  42. return
  43. " ITK_WRAP_TCL(target-name config-file1 [config-file2 ...])\n"
  44. "Run CABLE on all the configuration files to generate Tcl wrappers. "
  45. "The generated sources are added to a target of the given name. This "
  46. "command is provided for use by the Insight Toolkit (ITK) because it "
  47. "was originally written before loaded commands were supported.";
  48. }
  49. cmTypeMacro(cmITKWrapTclCommand, cmCommand);
  50. protected:
  51. void AddDependencies(cmDependInformation const*info,
  52. std::vector<std::string>& depends,
  53. std::set<cmDependInformation const*>& visited);
  54. cmStdString m_TargetName;
  55. cmTarget* m_Target;
  56. bool CreateCableRule(const char* configFile);
  57. std::string GetCableFromCache() const;
  58. cmMakeDepend* m_MakeDepend;
  59. };
  60. #endif