2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2008-01-28 16:38:36 +03:00
|
|
|
#ifndef cmExportBuildFileGenerator_h
|
|
|
|
#define cmExportBuildFileGenerator_h
|
|
|
|
|
|
|
|
#include "cmExportFileGenerator.h"
|
2012-10-06 19:16:11 +04:00
|
|
|
#include "cmListFileCache.h"
|
2008-01-31 01:25:52 +03:00
|
|
|
|
2013-12-23 20:07:26 +04:00
|
|
|
class cmExportSet;
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
/** \class cmExportBuildFileGenerator
|
|
|
|
* \brief Generate a file exporting targets from a build tree.
|
|
|
|
*
|
|
|
|
* cmExportBuildFileGenerator generates a file exporting targets from
|
|
|
|
* a build tree. A single file exports information for all
|
|
|
|
* configurations built.
|
|
|
|
*
|
|
|
|
* This is used to implement the EXPORT() command.
|
|
|
|
*/
|
|
|
|
class cmExportBuildFileGenerator: public cmExportFileGenerator
|
|
|
|
{
|
|
|
|
public:
|
2008-01-31 01:25:52 +03:00
|
|
|
cmExportBuildFileGenerator();
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
/** Set the list of targets to export. */
|
2012-10-06 19:27:40 +04:00
|
|
|
void SetTargets(std::vector<std::string> const& targets)
|
|
|
|
{ this->Targets = targets; }
|
2013-12-23 20:07:26 +04:00
|
|
|
void GetTargets(std::vector<std::string> &targets) const;
|
2012-10-06 19:27:40 +04:00
|
|
|
void AppendTargets(std::vector<std::string> const& targets)
|
|
|
|
{ this->Targets.insert(this->Targets.end(),
|
|
|
|
targets.begin(), targets.end()); }
|
2013-12-23 20:07:26 +04:00
|
|
|
void SetExportSet(cmExportSet*);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2008-01-28 21:21:42 +03:00
|
|
|
/** Set whether to append generated code to the output file. */
|
|
|
|
void SetAppendMode(bool append) { this->AppendMode = append; }
|
2008-01-31 01:25:52 +03:00
|
|
|
|
2012-10-06 19:16:11 +04:00
|
|
|
void SetMakefile(cmMakefile *mf) {
|
|
|
|
this->Makefile = mf;
|
|
|
|
this->Makefile->GetBacktrace(this->Backtrace);
|
|
|
|
}
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
protected:
|
|
|
|
// Implement virtual methods from the superclass.
|
|
|
|
virtual bool GenerateMainFile(std::ostream& os);
|
|
|
|
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
2014-02-10 07:48:34 +04:00
|
|
|
const std::string& config,
|
2013-01-13 12:44:52 +04:00
|
|
|
std::string const& suffix,
|
|
|
|
std::vector<std::string> &missingTargets);
|
2012-09-28 23:47:37 +04:00
|
|
|
virtual void HandleMissingTarget(std::string& link_libs,
|
|
|
|
std::vector<std::string>& missingTargets,
|
|
|
|
cmMakefile* mf,
|
|
|
|
cmTarget* depender,
|
|
|
|
cmTarget* dependee);
|
|
|
|
|
|
|
|
void ComplainAboutMissingTarget(cmTarget* depender,
|
2013-10-10 13:18:10 +04:00
|
|
|
cmTarget* dependee,
|
|
|
|
int occurrences);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
/** Fill in properties indicating built file locations. */
|
2014-02-10 07:48:34 +04:00
|
|
|
void SetImportLocationProperty(const std::string& config,
|
2008-01-28 16:38:36 +03:00
|
|
|
std::string const& suffix,
|
|
|
|
cmTarget* target,
|
|
|
|
ImportPropertyMap& properties);
|
|
|
|
|
2013-05-21 02:57:58 +04:00
|
|
|
std::string InstallNameDir(cmTarget* target, const std::string& config);
|
|
|
|
|
2013-10-10 13:18:10 +04:00
|
|
|
std::vector<std::string>
|
|
|
|
FindNamespaces(cmMakefile* mf, const std::string& name);
|
|
|
|
|
2012-10-06 19:27:40 +04:00
|
|
|
std::vector<std::string> Targets;
|
2013-12-23 20:07:26 +04:00
|
|
|
cmExportSet *ExportSet;
|
2012-10-06 19:27:40 +04:00
|
|
|
std::vector<cmTarget*> Exports;
|
2012-10-06 19:16:11 +04:00
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmListFileBacktrace Backtrace;
|
2008-01-28 16:38:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|