cmExportBuildFileGenerator.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. class cmExportCommand;
  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. /** Set the command instance through which errors should be reported. */
  33. void SetCommand(cmExportCommand* cmd) { this->ExportCommand = cmd; }
  34. protected:
  35. // Implement virtual methods from the superclass.
  36. virtual bool GenerateMainFile(std::ostream& os);
  37. virtual void GenerateImportTargetsConfig(std::ostream& os,
  38. const char* config,
  39. std::string const& suffix);
  40. virtual void HandleMissingTarget(std::string& link_libs,
  41. std::vector<std::string>& missingTargets,
  42. cmMakefile* mf,
  43. cmTarget* depender,
  44. cmTarget* dependee);
  45. void ComplainAboutMissingTarget(cmTarget* depender,
  46. cmTarget* dependee);
  47. /** Fill in properties indicating built file locations. */
  48. void SetImportLocationProperty(const char* config,
  49. std::string const& suffix,
  50. cmTarget* target,
  51. ImportPropertyMap& properties);
  52. std::vector<cmTarget*> const* Exports;
  53. cmExportCommand* ExportCommand;
  54. };
  55. #endif