cmITKWrapTclCommand.h 2.5 KB

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