export: Implement EXPORT subcommand (#9822)

Teach the export command to handle export sets defined by invocations
of install(TARGETS ... EXPORT foo).  This makes maintenance of targets
exported to both the build tree and install tree trivial.
This commit is contained in:
Stephen Kelly
2013-12-23 17:07:26 +01:00
parent e73d1ad003
commit cbe7e8fae4
16 changed files with 212 additions and 74 deletions
+5 -2
View File
@@ -15,6 +15,8 @@
#include "cmExportFileGenerator.h"
#include "cmListFileCache.h"
class cmExportSet;
/** \class cmExportBuildFileGenerator
* \brief Generate a file exporting targets from a build tree.
*
@@ -32,11 +34,11 @@ public:
/** Set the list of targets to export. */
void SetTargets(std::vector<std::string> const& targets)
{ this->Targets = targets; }
std::vector<std::string> const& GetTargets() const
{ return this->Targets; }
void GetTargets(std::vector<std::string> &targets) const;
void AppendTargets(std::vector<std::string> const& targets)
{ this->Targets.insert(this->Targets.end(),
targets.begin(), targets.end()); }
void SetExportSet(cmExportSet*);
/** Set whether to append generated code to the output file. */
void SetAppendMode(bool append) { this->AppendMode = append; }
@@ -75,6 +77,7 @@ protected:
FindNamespaces(cmMakefile* mf, const std::string& name);
std::vector<std::string> Targets;
cmExportSet *ExportSet;
std::vector<cmTarget*> Exports;
cmMakefile* Makefile;
cmListFileBacktrace Backtrace;