cmOutputRequiredFilesCommand.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 cmOutputRequiredFilesCommand_h
  14. #define cmOutputRequiredFilesCommand_h
  15. #include "cmCommand.h"
  16. #include "cmMakeDepend.h"
  17. /** \class cmOutputRequiredFilesCommand
  18. * \brief Output a list of required files for a source file
  19. *
  20. */
  21. class cmOutputRequiredFilesCommand : public cmCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmOutputRequiredFilesCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args);
  36. virtual void FinalPass();
  37. /**
  38. * The name of the command as specified in CMakeList.txt.
  39. */
  40. virtual const char* GetName() { return "output_required_files";}
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation()
  45. {
  46. return
  47. "Output a list of required source files for a specified source file.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " output_required_files(srcfile outputfile)\n"
  56. "Outputs a list of all the source files that are required by the "
  57. "specified srcfile. This list is written into outputfile. This is "
  58. "similar to writing out the dependencies for srcfile except that it "
  59. "jumps from .h files into .cxx, .c and .cpp files if possible.";
  60. }
  61. cmTypeMacro(cmOutputRequiredFilesCommand, cmCommand);
  62. void ListDependencies(cmDependInformation const *info,
  63. FILE *fout,
  64. std::set<cmDependInformation const*> *visited);
  65. private:
  66. std::string File;
  67. std::string OutputFile;
  68. };
  69. #endif