cmOutputRequiredFilesCommand.h 2.3 KB

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