cmExportBuildFileGenerator.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  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 cmExportBuildFileGenerator_h
  11. #define cmExportBuildFileGenerator_h
  12. #include "cmExportFileGenerator.h"
  13. #include "cmListFileCache.h"
  14. /** \class cmExportBuildFileGenerator
  15. * \brief Generate a file exporting targets from a build tree.
  16. *
  17. * cmExportBuildFileGenerator generates a file exporting targets from
  18. * a build tree. A single file exports information for all
  19. * configurations built.
  20. *
  21. * This is used to implement the EXPORT() command.
  22. */
  23. class cmExportBuildFileGenerator: public cmExportFileGenerator
  24. {
  25. public:
  26. cmExportBuildFileGenerator();
  27. /** Set the list of targets to export. */
  28. void SetExports(std::vector<cmTarget*> const* exports)
  29. { this->Exports = exports; }
  30. /** Set whether to append generated code to the output file. */
  31. void SetAppendMode(bool append) { this->AppendMode = append; }
  32. void SetMakefile(cmMakefile *mf) {
  33. this->Makefile = mf;
  34. this->Makefile->GetBacktrace(this->Backtrace);
  35. }
  36. protected:
  37. // Implement virtual methods from the superclass.
  38. virtual bool GenerateMainFile(std::ostream& os);
  39. virtual void GenerateImportTargetsConfig(std::ostream& os,
  40. const char* config,
  41. std::string const& suffix,
  42. std::vector<std::string> &missingTargets);
  43. virtual void HandleMissingTarget(std::string& link_libs,
  44. std::vector<std::string>& missingTargets,
  45. cmMakefile* mf,
  46. cmTarget* depender,
  47. cmTarget* dependee);
  48. void ComplainAboutMissingTarget(cmTarget* depender,
  49. cmTarget* dependee);
  50. /** Fill in properties indicating built file locations. */
  51. void SetImportLocationProperty(const char* config,
  52. std::string const& suffix,
  53. cmTarget* target,
  54. ImportPropertyMap& properties);
  55. std::string InstallNameDir(cmTarget* target, const std::string& config);
  56. std::vector<cmTarget*> const* Exports;
  57. cmMakefile* Makefile;
  58. cmListFileBacktrace Backtrace;
  59. };
  60. #endif