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 cmExportInstallFileGenerator_h
|
|
|
|
#define cmExportInstallFileGenerator_h
|
|
|
|
|
|
|
|
#include "cmExportFileGenerator.h"
|
|
|
|
|
|
|
|
class cmInstallExportGenerator;
|
|
|
|
class cmInstallTargetGenerator;
|
|
|
|
|
|
|
|
/** \class cmExportInstallFileGenerator
|
|
|
|
* \brief Generate a file exporting targets from an install tree.
|
|
|
|
*
|
|
|
|
* cmExportInstallFileGenerator generates files exporting targets from
|
|
|
|
* install an installation tree. The files are placed in a temporary
|
|
|
|
* location for installation by cmInstallExportGenerator. One main
|
|
|
|
* file is generated that creates the imported targets and loads
|
|
|
|
* per-configuration files. Target locations and settings for each
|
|
|
|
* configuration are written to these per-configuration files. After
|
|
|
|
* installation the main file loads the configurations that have been
|
|
|
|
* installed.
|
|
|
|
*
|
|
|
|
* This is used to implement the INSTALL(EXPORT) command.
|
|
|
|
*/
|
|
|
|
class cmExportInstallFileGenerator: public cmExportFileGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Construct with the export installer that will install the
|
|
|
|
files. */
|
|
|
|
cmExportInstallFileGenerator(cmInstallExportGenerator* iegen);
|
|
|
|
|
|
|
|
/** Get the per-config file generated for each configuraiton. This
|
|
|
|
maps from the configuration name to the file temporary location
|
|
|
|
for installation. */
|
2014-02-10 09:21:34 +04:00
|
|
|
std::map<std::string, std::string> const& GetConfigImportFiles()
|
2008-01-28 16:38:36 +03:00
|
|
|
{ return this->ConfigImportFiles; }
|
2009-01-07 22:16:28 +03:00
|
|
|
|
|
|
|
/** Compute the globbing expression used to load per-config import
|
|
|
|
files from the main file. */
|
|
|
|
std::string GetConfigImportFileGlob();
|
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,
|
2015-10-17 16:05:46 +03:00
|
|
|
cmGeneratorTarget* depender,
|
|
|
|
cmGeneratorTarget* dependee);
|
2012-09-28 23:47:37 +04:00
|
|
|
|
2013-01-27 12:43:44 +04:00
|
|
|
virtual void ReplaceInstallPrefix(std::string &input);
|
|
|
|
|
2015-10-17 16:05:46 +03:00
|
|
|
void ComplainAboutMissingTarget(cmGeneratorTarget* depender,
|
|
|
|
cmGeneratorTarget* dependee,
|
2012-09-28 23:47:37 +04:00
|
|
|
int occurrences);
|
|
|
|
|
2015-10-17 16:01:25 +03:00
|
|
|
std::vector<std::string> FindNamespaces(cmGlobalGenerator* gg,
|
2012-09-28 23:47:37 +04:00
|
|
|
const std::string& name);
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
/** Generate a per-configuration file for the targets. */
|
2014-02-10 07:48:34 +04:00
|
|
|
bool GenerateImportFileConfig(const std::string& config,
|
2013-01-13 12:44:52 +04:00
|
|
|
std::vector<std::string> &missingTargets);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
/** Fill in properties indicating installed 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,
|
|
|
|
cmInstallTargetGenerator* itgen,
|
2011-11-12 21:12:07 +04:00
|
|
|
ImportPropertyMap& properties,
|
|
|
|
std::set<std::string>& importedLocations
|
|
|
|
);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2015-08-04 20:19:47 +03:00
|
|
|
std::string InstallNameDir(cmGeneratorTarget* target,
|
|
|
|
const std::string& config);
|
2013-05-21 02:57:58 +04:00
|
|
|
|
2012-03-01 14:52:32 +04:00
|
|
|
cmInstallExportGenerator* IEGen;
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
// The import file generated for each configuration.
|
2014-02-10 09:21:34 +04:00
|
|
|
std::map<std::string, std::string> ConfigImportFiles;
|
2008-01-28 16:38:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|