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.
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
class cmExportBuildFileGenerator : public cmExportFileGenerator
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
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)
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
this->Targets = targets;
|
|
|
|
}
|
|
|
|
void GetTargets(std::vector<std::string>& targets) const;
|
2012-10-06 19:27:40 +04:00
|
|
|
void AppendTargets(std::vector<std::string> const& targets)
|
2016-05-16 17:34:04 +03:00
|
|
|
{
|
|
|
|
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
|
|
|
|
2015-09-16 23:08:22 +03:00
|
|
|
void Compute(cmLocalGenerator* lg);
|
2012-10-06 19:16:11 +04:00
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
protected:
|
|
|
|
// Implement virtual methods from the superclass.
|
2016-06-27 22:25:27 +03:00
|
|
|
bool GenerateMainFile(std::ostream& os) CM_OVERRIDE;
|
|
|
|
void GenerateImportTargetsConfig(
|
2016-05-16 17:34:04 +03:00
|
|
|
std::ostream& os, const std::string& config, std::string const& suffix,
|
2016-06-27 22:25:27 +03:00
|
|
|
std::vector<std::string>& missingTargets) CM_OVERRIDE;
|
|
|
|
void HandleMissingTarget(std::string& link_libs,
|
|
|
|
std::vector<std::string>& missingTargets,
|
|
|
|
cmGeneratorTarget* depender,
|
|
|
|
cmGeneratorTarget* dependee) CM_OVERRIDE;
|
2012-09-28 23:47:37 +04:00
|
|
|
|
2015-10-17 16:05:46 +03:00
|
|
|
void ComplainAboutMissingTarget(cmGeneratorTarget* depender,
|
|
|
|
cmGeneratorTarget* dependee,
|
2013-10-10 13:18:10 +04:00
|
|
|
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,
|
2012-10-06 19:44:17 +04:00
|
|
|
cmGeneratorTarget* target,
|
2008-01-28 16:38:36 +03:00
|
|
|
ImportPropertyMap& properties);
|
|
|
|
|
2015-08-04 20:19:47 +03:00
|
|
|
std::string InstallNameDir(cmGeneratorTarget* target,
|
2016-06-27 22:25:27 +03:00
|
|
|
const std::string& config) CM_OVERRIDE;
|
2013-05-21 02:57:58 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg,
|
|
|
|
const std::string& name);
|
2013-10-10 13:18:10 +04:00
|
|
|
|
2012-10-06 19:27:40 +04:00
|
|
|
std::vector<std::string> Targets;
|
2016-05-16 17:34:04 +03:00
|
|
|
cmExportSet* ExportSet;
|
2012-10-06 19:44:17 +04:00
|
|
|
std::vector<cmGeneratorTarget*> Exports;
|
2015-09-16 23:08:22 +03:00
|
|
|
cmLocalGenerator* LG;
|
2008-01-28 16:38:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|