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
|
|
|
#include "cmExportInstallFileGenerator.h"
|
|
|
|
|
2012-09-28 23:47:37 +04:00
|
|
|
#include "cmExportSet.h"
|
|
|
|
#include "cmExportSetMap.h"
|
2008-01-28 16:38:36 +03:00
|
|
|
#include "cmGeneratedFileStream.h"
|
2012-09-28 23:47:37 +04:00
|
|
|
#include "cmGlobalGenerator.h"
|
|
|
|
#include "cmLocalGenerator.h"
|
2008-01-28 16:38:36 +03:00
|
|
|
#include "cmInstallExportGenerator.h"
|
|
|
|
#include "cmInstallTargetGenerator.h"
|
2012-02-27 00:05:17 +04:00
|
|
|
#include "cmTargetExport.h"
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
cmExportInstallFileGenerator
|
|
|
|
::cmExportInstallFileGenerator(cmInstallExportGenerator* iegen):
|
2012-03-01 14:52:32 +04:00
|
|
|
IEGen(iegen)
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-01-07 22:16:28 +03:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
std::string cmExportInstallFileGenerator::GetConfigImportFileGlob()
|
|
|
|
{
|
|
|
|
std::string glob = this->FileBase;
|
|
|
|
glob += "-*";
|
|
|
|
glob += this->FileExt;
|
|
|
|
return glob;
|
|
|
|
}
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
|
|
|
{
|
2012-12-31 01:06:12 +04:00
|
|
|
std::vector<cmTarget*> allTargets;
|
2012-11-30 12:26:09 +04:00
|
|
|
{
|
|
|
|
std::string expectedTargets;
|
|
|
|
std::string sep;
|
|
|
|
for(std::vector<cmTargetExport*>::const_iterator
|
|
|
|
tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
|
|
|
|
tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
|
|
|
|
{
|
|
|
|
expectedTargets += sep + this->Namespace + (*tei)->Target->GetName();
|
|
|
|
sep = " ";
|
2012-02-27 10:09:40 +04:00
|
|
|
cmTargetExport const* te = *tei;
|
2008-02-06 22:20:36 +03:00
|
|
|
if(this->ExportedTargets.insert(te->Target).second)
|
|
|
|
{
|
2012-12-31 01:06:12 +04:00
|
|
|
allTargets.push_back(te->Target);
|
2008-02-06 22:20:36 +03:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cmOStringStream e;
|
2013-01-20 21:02:13 +04:00
|
|
|
e << "install(EXPORT \""
|
2012-03-01 14:52:32 +04:00
|
|
|
<< this->IEGen->GetExportSet()->GetName()
|
|
|
|
<< "\" ...) " << "includes target \"" << te->Target->GetName()
|
2008-02-06 22:20:36 +03:00
|
|
|
<< "\" more than once in the export set.";
|
|
|
|
cmSystemTools::Error(e.str().c_str());
|
|
|
|
return false;
|
|
|
|
}
|
2008-01-28 16:38:36 +03:00
|
|
|
}
|
|
|
|
|
2012-12-31 01:06:12 +04:00
|
|
|
this->GenerateExpectedTargetsCode(os, expectedTargets);
|
|
|
|
}
|
|
|
|
|
2012-09-23 15:45:17 +04:00
|
|
|
std::vector<std::string> missingTargets;
|
|
|
|
|
2012-12-31 01:06:12 +04:00
|
|
|
// Create all the imported targets.
|
|
|
|
for(std::vector<cmTarget*>::const_iterator
|
|
|
|
tei = allTargets.begin();
|
|
|
|
tei != allTargets.end(); ++tei)
|
|
|
|
{
|
|
|
|
cmTarget* te = *tei;
|
|
|
|
this->GenerateImportTargetCode(os, te);
|
2012-09-23 15:45:17 +04:00
|
|
|
|
|
|
|
ImportPropertyMap properties;
|
|
|
|
|
|
|
|
this->PopulateInterfaceProperty("INTERFACE_INCLUDE_DIRECTORIES",
|
|
|
|
te,
|
|
|
|
cmGeneratorExpression::InstallInterface,
|
|
|
|
properties, missingTargets);
|
|
|
|
this->PopulateInterfaceProperty("INTERFACE_COMPILE_DEFINITIONS",
|
|
|
|
te,
|
|
|
|
cmGeneratorExpression::InstallInterface,
|
|
|
|
properties, missingTargets);
|
2013-01-12 15:13:19 +04:00
|
|
|
this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
|
|
|
|
te, properties);
|
2013-01-20 20:09:29 +04:00
|
|
|
this->PopulateCompatibleInterfaceProperties(te, properties);
|
2012-09-23 15:45:17 +04:00
|
|
|
|
|
|
|
this->GenerateInterfaceProperties(te, os, properties);
|
2012-12-31 01:06:12 +04:00
|
|
|
}
|
|
|
|
|
2012-09-23 15:45:17 +04:00
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
// Now load per-configuration properties for them.
|
|
|
|
os << "# Load information for each installed configuration.\n"
|
2013-01-20 21:02:13 +04:00
|
|
|
<< "get_filename_component(_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n"
|
|
|
|
<< "file(GLOB CONFIG_FILES \"${_DIR}/"
|
2009-01-07 22:16:28 +03:00
|
|
|
<< this->GetConfigImportFileGlob() << "\")\n"
|
2013-01-20 21:02:13 +04:00
|
|
|
<< "foreach(f ${CONFIG_FILES})\n"
|
|
|
|
<< " include(${f})\n"
|
|
|
|
<< "endforeach()\n"
|
2008-01-28 16:38:36 +03:00
|
|
|
<< "\n";
|
|
|
|
|
2013-01-13 12:48:45 +04:00
|
|
|
this->GenerateImportedFileCheckLoop(os);
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
// Generate an import file for each configuration.
|
|
|
|
bool result = true;
|
|
|
|
for(std::vector<std::string>::const_iterator
|
|
|
|
ci = this->Configurations.begin();
|
|
|
|
ci != this->Configurations.end(); ++ci)
|
|
|
|
{
|
2013-01-13 12:44:52 +04:00
|
|
|
if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
result = false;
|
|
|
|
}
|
|
|
|
}
|
2013-01-13 12:44:52 +04:00
|
|
|
|
|
|
|
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
bool
|
2013-01-13 12:44:52 +04:00
|
|
|
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
|
|
|
|
std::vector<std::string> &missingTargets)
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
// Skip configurations not enabled for this export.
|
2012-03-01 14:52:32 +04:00
|
|
|
if(!this->IEGen->InstallsForConfig(config))
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Construct the name of the file to generate.
|
|
|
|
std::string fileName = this->FileDir;
|
|
|
|
fileName += "/";
|
|
|
|
fileName += this->FileBase;
|
|
|
|
fileName += "-";
|
|
|
|
if(config && *config)
|
|
|
|
{
|
|
|
|
fileName += cmSystemTools::LowerCase(config);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fileName += "noconfig";
|
|
|
|
}
|
|
|
|
fileName += this->FileExt;
|
|
|
|
|
|
|
|
// Open the output file to generate it.
|
|
|
|
cmGeneratedFileStream exportFileStream(fileName.c_str(), true);
|
|
|
|
if(!exportFileStream)
|
|
|
|
{
|
|
|
|
std::string se = cmSystemTools::GetLastSystemError();
|
|
|
|
cmOStringStream e;
|
|
|
|
e << "cannot write to file \"" << fileName.c_str()
|
|
|
|
<< "\": " << se;
|
|
|
|
cmSystemTools::Error(e.str().c_str());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
std::ostream& os = exportFileStream;
|
|
|
|
|
|
|
|
// Start with the import file header.
|
|
|
|
this->GenerateImportHeaderCode(os, config);
|
|
|
|
|
|
|
|
// Generate the per-config target information.
|
2013-01-13 12:44:52 +04:00
|
|
|
this->GenerateImportConfig(os, config, missingTargets);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
// End with the import file footer.
|
|
|
|
this->GenerateImportFooterCode(os);
|
|
|
|
|
|
|
|
// Record this per-config import file.
|
|
|
|
this->ConfigImportFiles[config] = fileName;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void
|
|
|
|
cmExportInstallFileGenerator
|
|
|
|
::GenerateImportTargetsConfig(std::ostream& os,
|
2013-01-13 12:44:52 +04:00
|
|
|
const char* config, std::string const& suffix,
|
|
|
|
std::vector<std::string> &missingTargets)
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
// Add code to compute the installation prefix relative to the
|
|
|
|
// import file location.
|
2012-03-01 14:52:32 +04:00
|
|
|
const char* installDest = this->IEGen->GetDestination();
|
2008-01-28 16:38:36 +03:00
|
|
|
if(!cmSystemTools::FileIsFullPath(installDest))
|
|
|
|
{
|
|
|
|
std::string dest = installDest;
|
|
|
|
os << "# Compute the installation prefix relative to this file.\n"
|
2013-01-20 21:02:13 +04:00
|
|
|
<< "get_filename_component(_IMPORT_PREFIX "
|
2008-01-28 16:38:36 +03:00
|
|
|
<< "\"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n";
|
|
|
|
while(!dest.empty())
|
|
|
|
{
|
|
|
|
os <<
|
2013-01-20 21:02:13 +04:00
|
|
|
"get_filename_component(_IMPORT_PREFIX \"${_IMPORT_PREFIX}\" PATH)\n";
|
2008-01-28 16:38:36 +03:00
|
|
|
dest = cmSystemTools::GetFilenamePath(dest);
|
|
|
|
}
|
|
|
|
os << "\n";
|
|
|
|
|
|
|
|
// Import location properties may reference this variable.
|
|
|
|
this->ImportPrefix = "${_IMPORT_PREFIX}/";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add each target in the set to the export.
|
2012-09-25 21:19:27 +04:00
|
|
|
for(std::vector<cmTargetExport*>::const_iterator
|
2012-03-01 14:52:32 +04:00
|
|
|
tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
|
|
|
|
tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
// Collect import properties for this target.
|
2012-02-27 10:09:40 +04:00
|
|
|
cmTargetExport const* te = *tei;
|
2008-01-28 16:38:36 +03:00
|
|
|
ImportPropertyMap properties;
|
2011-11-12 21:12:07 +04:00
|
|
|
std::set<std::string> importedLocations;
|
|
|
|
this->SetImportLocationProperty(config, suffix, te->ArchiveGenerator,
|
|
|
|
properties, importedLocations);
|
|
|
|
this->SetImportLocationProperty(config, suffix, te->LibraryGenerator,
|
|
|
|
properties, importedLocations);
|
2008-01-28 16:38:36 +03:00
|
|
|
this->SetImportLocationProperty(config, suffix,
|
2011-11-12 21:12:07 +04:00
|
|
|
te->RuntimeGenerator, properties,
|
|
|
|
importedLocations);
|
|
|
|
this->SetImportLocationProperty(config, suffix, te->FrameworkGenerator,
|
|
|
|
properties, importedLocations);
|
|
|
|
this->SetImportLocationProperty(config, suffix, te->BundleGenerator,
|
|
|
|
properties, importedLocations);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
// If any file location was set for the target add it to the
|
|
|
|
// import file.
|
|
|
|
if(!properties.empty())
|
|
|
|
{
|
|
|
|
// Get the rest of the target details.
|
|
|
|
this->SetImportDetailProperties(config, suffix,
|
2012-09-16 00:38:30 +04:00
|
|
|
te->Target, properties, missingTargets);
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2013-01-04 18:58:16 +04:00
|
|
|
this->SetImportLinkInterface(config, suffix,
|
|
|
|
cmGeneratorExpression::InstallInterface,
|
|
|
|
te->Target, properties, missingTargets);
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
// TOOD: PUBLIC_HEADER_LOCATION
|
2008-01-28 23:22:07 +03:00
|
|
|
// This should wait until the build feature propagation stuff
|
|
|
|
// is done. Then this can be a propagated include directory.
|
2008-01-28 16:38:36 +03:00
|
|
|
// this->GenerateImportProperty(config, te->HeaderGenerator,
|
|
|
|
// properties);
|
|
|
|
|
|
|
|
// Generate code in the export file.
|
|
|
|
this->GenerateImportPropertyCode(os, config, te->Target, properties);
|
2011-11-12 21:12:07 +04:00
|
|
|
this->GenerateImportedFileChecksCode(os, te->Target, properties,
|
|
|
|
importedLocations);
|
2008-01-28 16:38:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Cleanup the import prefix variable.
|
|
|
|
if(!this->ImportPrefix.empty())
|
|
|
|
{
|
|
|
|
os << "# Cleanup temporary variables.\n"
|
2013-01-20 21:02:13 +04:00
|
|
|
<< "set(_IMPORT_PREFIX)\n"
|
2008-01-28 16:38:36 +03:00
|
|
|
<< "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void
|
|
|
|
cmExportInstallFileGenerator
|
|
|
|
::SetImportLocationProperty(const char* config, 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
|
|
|
{
|
|
|
|
// Skip rules that do not match this configuration.
|
|
|
|
if(!(itgen && itgen->InstallsForConfig(config)))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-02-06 22:20:36 +03:00
|
|
|
// Get the target to be installed.
|
|
|
|
cmTarget* target = itgen->GetTarget();
|
2008-01-28 16:38:36 +03:00
|
|
|
|
|
|
|
// Construct the installed location of the target.
|
|
|
|
std::string dest = itgen->GetDestination();
|
|
|
|
std::string value;
|
|
|
|
if(!cmSystemTools::FileIsFullPath(dest.c_str()))
|
|
|
|
{
|
|
|
|
// The target is installed relative to the installation prefix.
|
|
|
|
if(this->ImportPrefix.empty())
|
|
|
|
{
|
|
|
|
this->ComplainAboutImportPrefix(itgen);
|
|
|
|
}
|
|
|
|
value = this->ImportPrefix;
|
|
|
|
}
|
|
|
|
value += dest;
|
|
|
|
value += "/";
|
|
|
|
|
2008-02-06 22:20:36 +03:00
|
|
|
if(itgen->IsImportLibrary())
|
2008-01-28 21:05:58 +03:00
|
|
|
{
|
2008-02-06 22:20:36 +03:00
|
|
|
// Construct the property name.
|
|
|
|
std::string prop = "IMPORTED_IMPLIB";
|
|
|
|
prop += suffix;
|
|
|
|
|
|
|
|
// Append the installed file name.
|
|
|
|
value += itgen->GetInstallFilename(target, config,
|
|
|
|
cmInstallTargetGenerator::NameImplib);
|
|
|
|
|
|
|
|
// Store the property.
|
|
|
|
properties[prop] = value;
|
2011-11-12 21:12:07 +04:00
|
|
|
importedLocations.insert(prop);
|
2008-01-28 21:05:58 +03:00
|
|
|
}
|
2008-02-06 22:20:36 +03:00
|
|
|
else
|
2008-01-28 22:46:16 +03:00
|
|
|
{
|
2008-02-06 22:20:36 +03:00
|
|
|
// Construct the property name.
|
|
|
|
std::string prop = "IMPORTED_LOCATION";
|
|
|
|
prop += suffix;
|
2008-01-28 16:38:36 +03:00
|
|
|
|
2008-02-06 22:20:36 +03:00
|
|
|
// Append the installed file name.
|
|
|
|
if(target->IsFrameworkOnApple())
|
|
|
|
{
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
value += ".framework/";
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
}
|
2010-10-07 06:43:04 +04:00
|
|
|
else if(target->IsCFBundleOnApple())
|
|
|
|
{
|
|
|
|
const char *ext = target->GetProperty("BUNDLE_EXTENSION");
|
|
|
|
if (!ext)
|
|
|
|
{
|
|
|
|
ext = "bundle";
|
|
|
|
}
|
|
|
|
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
value += ".";
|
|
|
|
value += ext;
|
|
|
|
value += "/";
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
}
|
2008-02-06 22:20:36 +03:00
|
|
|
else if(target->IsAppBundleOnApple())
|
|
|
|
{
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
value += ".app/Contents/MacOS/";
|
|
|
|
value += itgen->GetInstallFilename(target, config);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value += itgen->GetInstallFilename(target, config,
|
|
|
|
cmInstallTargetGenerator::NameReal);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Store the property.
|
|
|
|
properties[prop] = value;
|
2011-11-12 21:12:07 +04:00
|
|
|
importedLocations.insert(prop);
|
2008-02-06 22:20:36 +03:00
|
|
|
}
|
2008-01-28 16:38:36 +03:00
|
|
|
}
|
|
|
|
|
2012-09-28 23:47:37 +04:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void
|
|
|
|
cmExportInstallFileGenerator::HandleMissingTarget(
|
|
|
|
std::string& link_libs, std::vector<std::string>& missingTargets,
|
|
|
|
cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
|
|
|
|
{
|
|
|
|
std::string name = dependee->GetName();
|
|
|
|
std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
|
|
|
|
int targetOccurrences = (int)namespaces.size();
|
|
|
|
if (targetOccurrences == 1)
|
|
|
|
{
|
|
|
|
std::string missingTarget = namespaces[0];
|
|
|
|
missingTarget += name;
|
|
|
|
link_libs += missingTarget;
|
|
|
|
missingTargets.push_back(missingTarget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// We are not appending, so all exported targets should be
|
|
|
|
// known here. This is probably user-error.
|
|
|
|
this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
std::vector<std::string>
|
|
|
|
cmExportInstallFileGenerator
|
|
|
|
::FindNamespaces(cmMakefile* mf, const std::string& name)
|
|
|
|
{
|
|
|
|
std::vector<std::string> namespaces;
|
|
|
|
cmGlobalGenerator* gg = mf->GetLocalGenerator()->GetGlobalGenerator();
|
|
|
|
const cmExportSetMap& exportSets = gg->GetExportSets();
|
|
|
|
|
|
|
|
for(cmExportSetMap::const_iterator expIt = exportSets.begin();
|
|
|
|
expIt != exportSets.end();
|
|
|
|
++expIt)
|
|
|
|
{
|
|
|
|
const cmExportSet* exportSet = expIt->second;
|
|
|
|
std::vector<cmTargetExport*> const* targets =
|
|
|
|
exportSet->GetTargetExports();
|
|
|
|
|
|
|
|
bool containsTarget = false;
|
|
|
|
for(unsigned int i=0; i<targets->size(); i++)
|
|
|
|
{
|
|
|
|
if (name == (*targets)[i]->Target->GetName())
|
|
|
|
{
|
|
|
|
containsTarget = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (containsTarget)
|
|
|
|
{
|
|
|
|
std::vector<cmInstallExportGenerator const*> const* installs =
|
|
|
|
exportSet->GetInstallations();
|
|
|
|
for(unsigned int i=0; i<installs->size(); i++)
|
|
|
|
{
|
|
|
|
namespaces.push_back((*installs)[i]->GetNamespace());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return namespaces;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-28 16:38:36 +03:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void
|
|
|
|
cmExportInstallFileGenerator
|
|
|
|
::ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen)
|
|
|
|
{
|
2012-03-01 14:52:32 +04:00
|
|
|
const char* installDest = this->IEGen->GetDestination();
|
2008-01-28 16:38:36 +03:00
|
|
|
cmOStringStream e;
|
2013-01-20 21:02:13 +04:00
|
|
|
e << "install(EXPORT \""
|
2012-03-01 14:52:32 +04:00
|
|
|
<< this->IEGen->GetExportSet()->GetName()
|
|
|
|
<< "\") given absolute "
|
2008-01-28 16:38:36 +03:00
|
|
|
<< "DESTINATION \"" << installDest << "\" but the export "
|
|
|
|
<< "references an installation of target \""
|
|
|
|
<< itgen->GetTarget()->GetName() << "\" which has relative "
|
|
|
|
<< "DESTINATION \"" << itgen->GetDestination() << "\".";
|
|
|
|
cmSystemTools::Error(e.str().c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
void
|
|
|
|
cmExportInstallFileGenerator
|
2012-09-15 23:55:24 +04:00
|
|
|
::ComplainAboutMissingTarget(cmTarget* depender,
|
|
|
|
cmTarget* dependee,
|
|
|
|
int occurrences)
|
2008-01-28 16:38:36 +03:00
|
|
|
{
|
|
|
|
cmOStringStream e;
|
2013-01-20 21:02:13 +04:00
|
|
|
e << "install(EXPORT \""
|
2012-03-01 14:52:32 +04:00
|
|
|
<< this->IEGen->GetExportSet()->GetName()
|
|
|
|
<< "\" ...) "
|
2008-02-01 16:56:00 +03:00
|
|
|
<< "includes target \"" << depender->GetName()
|
2012-09-15 23:55:24 +04:00
|
|
|
<< "\" which requires target \"" << dependee->GetName() << "\" ";
|
|
|
|
if (occurrences == 0)
|
|
|
|
{
|
|
|
|
e << "that is not in the export set.";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
e << "that is not in this export set, but " << occurrences
|
|
|
|
<< " times in others.";
|
|
|
|
}
|
2008-01-31 01:25:52 +03:00
|
|
|
cmSystemTools::Error(e.str().c_str());
|
2008-01-28 16:38:36 +03:00
|
|
|
}
|