cmExportTryCompileFileGenerator.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2013 Stephen Kelly <[email protected]>
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmExportTryCompileFileGenerator_h
  11. #define cmExportTryCompileFileGenerator_h
  12. #include <cmConfigure.h>
  13. #include "cmExportFileGenerator.h"
  14. #include <iosfwd>
  15. #include <set>
  16. #include <string>
  17. #include <vector>
  18. class cmGeneratorTarget;
  19. class cmGlobalGenerator;
  20. class cmMakefile;
  21. class cmExportTryCompileFileGenerator : public cmExportFileGenerator
  22. {
  23. public:
  24. cmExportTryCompileFileGenerator(cmGlobalGenerator* gg,
  25. std::vector<std::string> const& targets,
  26. cmMakefile* mf);
  27. /** Set the list of targets to export. */
  28. void SetConfig(const std::string& config) { this->Config = config; }
  29. protected:
  30. // Implement virtual methods from the superclass.
  31. bool GenerateMainFile(std::ostream& os) CM_OVERRIDE;
  32. void GenerateImportTargetsConfig(std::ostream&, const std::string&,
  33. std::string const&,
  34. std::vector<std::string>&) CM_OVERRIDE
  35. {
  36. }
  37. void HandleMissingTarget(std::string&, std::vector<std::string>&,
  38. cmGeneratorTarget*, cmGeneratorTarget*) CM_OVERRIDE
  39. {
  40. }
  41. void PopulateProperties(cmGeneratorTarget const* target,
  42. ImportPropertyMap& properties,
  43. std::set<const cmGeneratorTarget*>& emitted);
  44. std::string InstallNameDir(cmGeneratorTarget* target,
  45. const std::string& config) CM_OVERRIDE;
  46. private:
  47. std::string FindTargets(const std::string& prop,
  48. const cmGeneratorTarget* tgt,
  49. std::set<const cmGeneratorTarget*>& emitted);
  50. std::vector<cmGeneratorTarget const*> Exports;
  51. std::string Config;
  52. };
  53. #endif