cmExportTryCompileFileGenerator.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 "cmExportFileGenerator.h"
  13. class cmInstallExportGenerator;
  14. class cmInstallTargetGenerator;
  15. class cmExportTryCompileFileGenerator: public cmExportFileGenerator
  16. {
  17. public:
  18. cmExportTryCompileFileGenerator(cmGlobalGenerator* gg,
  19. std::vector<std::string> const& targets,
  20. cmMakefile* mf);
  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. virtual bool GenerateMainFile(std::ostream& os);
  26. virtual void GenerateImportTargetsConfig(std::ostream&,
  27. const std::string&,
  28. std::string const&,
  29. std::vector<std::string>&) {}
  30. virtual void HandleMissingTarget(std::string&,
  31. std::vector<std::string>&,
  32. cmTarget*,
  33. cmTarget*) {}
  34. void PopulateProperties(cmGeneratorTarget const* target,
  35. ImportPropertyMap& properties,
  36. std::set<const cmGeneratorTarget*>& emitted);
  37. std::string InstallNameDir(cmGeneratorTarget* target,
  38. const std::string& config);
  39. private:
  40. std::string FindTargets(const std::string& prop,
  41. const cmGeneratorTarget* tgt,
  42. std::set<const cmGeneratorTarget*>& emitted);
  43. std::vector<cmGeneratorTarget const*> Exports;
  44. std::string Config;
  45. };
  46. #endif