cmExportTryCompileFileGenerator.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmExportTryCompileFileGenerator_h
  4. #define cmExportTryCompileFileGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmExportFileGenerator.h"
  7. #include <iosfwd>
  8. #include <set>
  9. #include <string>
  10. #include <vector>
  11. class cmGeneratorTarget;
  12. class cmGlobalGenerator;
  13. class cmMakefile;
  14. class cmExportTryCompileFileGenerator : public cmExportFileGenerator
  15. {
  16. public:
  17. cmExportTryCompileFileGenerator(cmGlobalGenerator* gg,
  18. std::vector<std::string> const& targets,
  19. cmMakefile* mf,
  20. std::set<std::string> const& langs);
  21. /** Set the list of targets to export. */
  22. void SetConfig(const std::string& config) { this->Config = config; }
  23. protected:
  24. // Implement virtual methods from the superclass.
  25. bool GenerateMainFile(std::ostream& os) override;
  26. void GenerateImportTargetsConfig(std::ostream&, const std::string&,
  27. std::string const&,
  28. std::vector<std::string>&) override
  29. {
  30. }
  31. void HandleMissingTarget(std::string&, std::vector<std::string>&,
  32. cmGeneratorTarget*, cmGeneratorTarget*) override
  33. {
  34. }
  35. void PopulateProperties(cmGeneratorTarget const* target,
  36. ImportPropertyMap& properties,
  37. std::set<const cmGeneratorTarget*>& emitted);
  38. std::string InstallNameDir(cmGeneratorTarget* target,
  39. const std::string& config) override;
  40. private:
  41. std::string FindTargets(const std::string& prop,
  42. const cmGeneratorTarget* tgt,
  43. std::string const& language,
  44. std::set<const cmGeneratorTarget*>& emitted);
  45. std::vector<cmGeneratorTarget const*> Exports;
  46. std::string Config;
  47. std::vector<std::string> Languages;
  48. };
  49. #endif