cmExportBuildCMakeConfigGenerator.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file LICENSE.rst or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <iosfwd>
  6. #include <string>
  7. #include "cmExportBuildFileGenerator.h"
  8. #include "cmExportCMakeConfigGenerator.h"
  9. /** \class cmExportBuildCMakeConfigGenerator
  10. * \brief Generate a file exporting targets from a build tree.
  11. *
  12. * cmExportBuildCMakeConfigGenerator generates a file exporting targets from
  13. * a build tree. This exports the targets to CMake's native package
  14. * configuration format. A single file exports information for all
  15. * configurations built.
  16. *
  17. * This is used to implement the export() command.
  18. */
  19. class cmExportBuildCMakeConfigGenerator
  20. : public cmExportCMakeConfigGenerator
  21. , public cmExportBuildFileGenerator
  22. {
  23. public:
  24. cmExportBuildCMakeConfigGenerator();
  25. /** Set whether to append generated code to the output file. */
  26. void SetAppendMode(bool append) { this->AppendMode = append; }
  27. protected:
  28. // Implement virtual methods from the superclass.
  29. bool GenerateMainFile(std::ostream& os) override;
  30. void GenerateImportTargetsConfig(std::ostream& os, std::string const& config,
  31. std::string const& suffix) override;
  32. std::string GetFileSetDirectories(cmGeneratorTarget* gte, cmFileSet* fileSet,
  33. cmTargetExport const* te) override;
  34. std::string GetFileSetFiles(cmGeneratorTarget* gte, cmFileSet* fileSet,
  35. cmTargetExport const* te) override;
  36. void GenerateCxxModuleConfigInformation(std::string const&,
  37. std::ostream&) const override;
  38. bool GenerateImportCxxModuleConfigTargetInclusion(std::string const&,
  39. std::string) const;
  40. };