Merge topic 'use-generator-target'
57f03e59 Port some of the cmExportFileGenerator API to cmGeneratorTarget. 57ab0f70 Port cmExportBuildFileGenerator to cmGeneratorTarget. 570938cb cmExportTryCompileFileGenerator: Create cmGeneratorTargets. ec38e4c8 Move GetFullPath to cmGeneratorTarget dfb025bf Move GetLocationForBuild to cmGeneratorTarget. 9f2dca80 Move GetLocation to cmGeneratorTarget. c7a8e74b Always access target location from a cmGeneratorTarget instance. 5b60eaf6 cmTarget: Restore the ImportedGetLocation method. 50b17a61 cmIncludeCommand: Populate the cmGeneratorTargets in deprecated path. ba266858 cmTarget: Create cmGeneratorTargets before reading deprecated LOCATION. 5ab3a946 cmTarget: Inline GetLocation into deprecated callers. 496f4cd0 cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc. de80993a cmGlobalGenerator: Create cmGeneratorTargets earlier. 611220f7 cmTarget: Use reliable test for CMP0024 and CMP0026 OLD. bbad6ba5 cmLocalGenerator: Remove unused AddCustomCommandToCreateObject method. e4dc83ad cmLocalGenerator: Remove unused AddBuildTargetRule method. ...
This commit is contained in:
commit
98d6e9ec2d
@ -1,13 +1,14 @@
|
|||||||
#include "cmCPackPropertiesGenerator.h"
|
#include "cmCPackPropertiesGenerator.h"
|
||||||
|
|
||||||
#include "cmOutputConverter.h"
|
#include "cmOutputConverter.h"
|
||||||
|
#include "cmLocalGenerator.h"
|
||||||
|
|
||||||
cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
|
cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
|
||||||
cmMakefile* mf,
|
cmLocalGenerator* lg,
|
||||||
cmInstalledFile const& installedFile,
|
cmInstalledFile const& installedFile,
|
||||||
std::vector<std::string> const& configurations):
|
std::vector<std::string> const& configurations):
|
||||||
cmScriptGenerator("CPACK_BUILD_CONFIG", configurations),
|
cmScriptGenerator("CPACK_BUILD_CONFIG", configurations),
|
||||||
Makefile(mf),
|
LG(lg),
|
||||||
InstalledFile(installedFile)
|
InstalledFile(installedFile)
|
||||||
{
|
{
|
||||||
this->ActionsPerConfig = true;
|
this->ActionsPerConfig = true;
|
||||||
@ -17,7 +18,8 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
|
|||||||
const std::string& config, Indent const& indent)
|
const std::string& config, Indent const& indent)
|
||||||
{
|
{
|
||||||
std::string const& expandedFileName =
|
std::string const& expandedFileName =
|
||||||
this->InstalledFile.GetNameExpression().Evaluate(this->Makefile, config);
|
this->InstalledFile.GetNameExpression().Evaluate(this->LG->GetMakefile(),
|
||||||
|
config);
|
||||||
|
|
||||||
cmInstalledFile::PropertyMapType const& properties =
|
cmInstalledFile::PropertyMapType const& properties =
|
||||||
this->InstalledFile.GetProperties();
|
this->InstalledFile.GetProperties();
|
||||||
@ -36,7 +38,7 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
|
|||||||
j = property.ValueExpressions.begin();
|
j = property.ValueExpressions.begin();
|
||||||
j != property.ValueExpressions.end(); ++j)
|
j != property.ValueExpressions.end(); ++j)
|
||||||
{
|
{
|
||||||
std::string value = (*j)->Evaluate(this->Makefile, config);
|
std::string value = (*j)->Evaluate(LG->GetMakefile(), config);
|
||||||
os << " " << cmOutputConverter::EscapeForCMake(value);
|
os << " " << cmOutputConverter::EscapeForCMake(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
#include "cmScriptGenerator.h"
|
#include "cmScriptGenerator.h"
|
||||||
#include "cmInstalledFile.h"
|
#include "cmInstalledFile.h"
|
||||||
|
|
||||||
|
class cmLocalGenerator;
|
||||||
|
|
||||||
/** \class cmCPackPropertiesGenerator
|
/** \class cmCPackPropertiesGenerator
|
||||||
* \brief Support class for generating CPackProperties.cmake.
|
* \brief Support class for generating CPackProperties.cmake.
|
||||||
*
|
*
|
||||||
@ -23,7 +25,7 @@ class cmCPackPropertiesGenerator: public cmScriptGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmCPackPropertiesGenerator(
|
cmCPackPropertiesGenerator(
|
||||||
cmMakefile* mf,
|
cmLocalGenerator* lg,
|
||||||
cmInstalledFile const& installedFile,
|
cmInstalledFile const& installedFile,
|
||||||
std::vector<std::string> const& configurations);
|
std::vector<std::string> const& configurations);
|
||||||
|
|
||||||
@ -31,7 +33,7 @@ protected:
|
|||||||
virtual void GenerateScriptForConfig(std::ostream& os,
|
virtual void GenerateScriptForConfig(std::ostream& os,
|
||||||
const std::string& config, Indent const& indent);
|
const std::string& config, Indent const& indent);
|
||||||
|
|
||||||
cmMakefile* Makefile;
|
cmLocalGenerator* LG;
|
||||||
cmInstalledFile const& InstalledFile;
|
cmInstalledFile const& InstalledFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -535,10 +535,13 @@ bool cmComputeLinkInformation::Compute()
|
|||||||
i != wrongItems.end(); ++i)
|
i != wrongItems.end(); ++i)
|
||||||
{
|
{
|
||||||
cmTarget const* tgt = *i;
|
cmTarget const* tgt = *i;
|
||||||
|
cmGeneratorTarget *gtgt = tgt->GetMakefile()
|
||||||
|
->GetGlobalGenerator()
|
||||||
|
->GetGeneratorTarget(tgt);
|
||||||
bool implib =
|
bool implib =
|
||||||
(this->UseImportLibrary &&
|
(this->UseImportLibrary &&
|
||||||
(tgt->GetType() == cmTarget::SHARED_LIBRARY));
|
(tgt->GetType() == cmTarget::SHARED_LIBRARY));
|
||||||
std::string lib = tgt->GetFullPath(this->Config , implib, true);
|
std::string lib = gtgt->GetFullPath(this->Config , implib, true);
|
||||||
this->OldLinkDirItems.push_back(lib);
|
this->OldLinkDirItems.push_back(lib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -637,6 +640,9 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
|
|||||||
|
|
||||||
if(tgt && tgt->IsLinkable())
|
if(tgt && tgt->IsLinkable())
|
||||||
{
|
{
|
||||||
|
cmGeneratorTarget *gtgt = tgt->GetMakefile()
|
||||||
|
->GetGlobalGenerator()
|
||||||
|
->GetGeneratorTarget(tgt);
|
||||||
// This is a CMake target. Ask the target for its real name.
|
// This is a CMake target. Ask the target for its real name.
|
||||||
if(impexe && this->LoaderFlag)
|
if(impexe && this->LoaderFlag)
|
||||||
{
|
{
|
||||||
@ -645,7 +651,8 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
|
|||||||
// platform. Add it now.
|
// platform. Add it now.
|
||||||
std::string linkItem;
|
std::string linkItem;
|
||||||
linkItem = this->LoaderFlag;
|
linkItem = this->LoaderFlag;
|
||||||
std::string exe = tgt->GetFullPath(config, this->UseImportLibrary,
|
|
||||||
|
std::string exe = gtgt->GetFullPath(config, this->UseImportLibrary,
|
||||||
true);
|
true);
|
||||||
linkItem += exe;
|
linkItem += exe;
|
||||||
this->Items.push_back(Item(linkItem, true, tgt));
|
this->Items.push_back(Item(linkItem, true, tgt));
|
||||||
@ -666,7 +673,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
|
|||||||
(impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY));
|
(impexe || tgt->GetType() == cmTarget::SHARED_LIBRARY));
|
||||||
|
|
||||||
// Pass the full path to the target file.
|
// Pass the full path to the target file.
|
||||||
std::string lib = tgt->GetFullPath(config, implib, true);
|
std::string lib = gtgt->GetFullPath(config, implib, true);
|
||||||
if(!this->LinkDependsNoShared ||
|
if(!this->LinkDependsNoShared ||
|
||||||
tgt->GetType() != cmTarget::SHARED_LIBRARY)
|
tgt->GetType() != cmTarget::SHARED_LIBRARY)
|
||||||
{
|
{
|
||||||
@ -755,7 +762,10 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
|
|||||||
std::string lib;
|
std::string lib;
|
||||||
if(tgt)
|
if(tgt)
|
||||||
{
|
{
|
||||||
lib = tgt->GetFullPath(this->Config, this->UseImportLibrary);
|
cmGeneratorTarget *gtgt = tgt->GetMakefile()
|
||||||
|
->GetGlobalGenerator()
|
||||||
|
->GetGeneratorTarget(tgt);
|
||||||
|
lib = gtgt->GetFullPath(this->Config, this->UseImportLibrary);
|
||||||
this->AddLibraryRuntimeInfo(lib, tgt);
|
this->AddLibraryRuntimeInfo(lib, tgt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -379,7 +379,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
|
|||||||
if (!targets.empty())
|
if (!targets.empty())
|
||||||
{
|
{
|
||||||
std::string fname = "/" + std::string(targetName) + "Targets.cmake";
|
std::string fname = "/" + std::string(targetName) + "Targets.cmake";
|
||||||
cmExportTryCompileFileGenerator tcfg;
|
cmExportTryCompileFileGenerator tcfg(gg);
|
||||||
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
|
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
|
||||||
tcfg.SetExports(targets);
|
tcfg.SetExports(targets);
|
||||||
tcfg.SetConfig(this->Makefile->GetSafeDefinition(
|
tcfg.SetConfig(this->Makefile->GetSafeDefinition(
|
||||||
|
@ -12,14 +12,15 @@
|
|||||||
#include "cmCustomCommandGenerator.h"
|
#include "cmCustomCommandGenerator.h"
|
||||||
|
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
#include "cmLocalGenerator.h"
|
||||||
#include "cmCustomCommand.h"
|
#include "cmCustomCommand.h"
|
||||||
#include "cmOutputConverter.h"
|
#include "cmOutputConverter.h"
|
||||||
#include "cmGeneratorExpression.h"
|
#include "cmGeneratorExpression.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmCustomCommandGenerator::cmCustomCommandGenerator(
|
cmCustomCommandGenerator::cmCustomCommandGenerator(
|
||||||
cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
|
cmCustomCommand const& cc, const std::string& config, cmLocalGenerator* lg):
|
||||||
CC(cc), Config(config), Makefile(mf),
|
CC(cc), Config(config), LG(lg),
|
||||||
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
|
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
|
||||||
GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false)
|
GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false)
|
||||||
{
|
{
|
||||||
@ -41,13 +42,16 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
|
|||||||
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
||||||
{
|
{
|
||||||
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
|
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
|
||||||
cmTarget* target = this->Makefile->FindTargetToUse(argv0);
|
cmGeneratorTarget* target =
|
||||||
|
this->LG->GetMakefile()->FindGeneratorTargetToUse(argv0);
|
||||||
if(target && target->GetType() == cmTarget::EXECUTABLE &&
|
if(target && target->GetType() == cmTarget::EXECUTABLE &&
|
||||||
(target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
|
(target->Target->IsImported()
|
||||||
|
|| !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")))
|
||||||
{
|
{
|
||||||
return target->GetLocation(this->Config);
|
return target->GetLocation(this->Config);
|
||||||
}
|
}
|
||||||
return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config);
|
return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(),
|
||||||
|
this->Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -87,8 +91,9 @@ cmCustomCommandGenerator
|
|||||||
cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
|
cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c];
|
||||||
for(unsigned int j=1;j < commandLine.size(); ++j)
|
for(unsigned int j=1;j < commandLine.size(); ++j)
|
||||||
{
|
{
|
||||||
std::string arg = this->GE->Parse(commandLine[j])->Evaluate(this->Makefile,
|
std::string arg =
|
||||||
this->Config);
|
this->GE->Parse(commandLine[j])->Evaluate(this->LG->GetMakefile(),
|
||||||
|
this->Config);
|
||||||
cmd += " ";
|
cmd += " ";
|
||||||
if(this->OldStyle)
|
if(this->OldStyle)
|
||||||
{
|
{
|
||||||
@ -96,7 +101,7 @@ cmCustomCommandGenerator
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmOutputConverter converter(this->Makefile->GetStateSnapshot());
|
cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot());
|
||||||
cmd += converter.EscapeForShell(arg, this->MakeVars);
|
cmd += converter.EscapeForShell(arg, this->MakeVars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,7 +146,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
|
|||||||
= this->GE->Parse(*i);
|
= this->GE->Parse(*i);
|
||||||
std::vector<std::string> result;
|
std::vector<std::string> result;
|
||||||
cmSystemTools::ExpandListArgument(
|
cmSystemTools::ExpandListArgument(
|
||||||
cge->Evaluate(this->Makefile, this->Config), result);
|
cge->Evaluate(this->LG->GetMakefile(), this->Config), result);
|
||||||
for (std::vector<std::string>::iterator it = result.begin();
|
for (std::vector<std::string>::iterator it = result.begin();
|
||||||
it != result.end(); ++it)
|
it != result.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
#include "cmStandardIncludes.h"
|
#include "cmStandardIncludes.h"
|
||||||
|
|
||||||
class cmCustomCommand;
|
class cmCustomCommand;
|
||||||
class cmMakefile;
|
class cmLocalGenerator;
|
||||||
class cmGeneratorExpression;
|
class cmGeneratorExpression;
|
||||||
|
|
||||||
class cmCustomCommandGenerator
|
class cmCustomCommandGenerator
|
||||||
{
|
{
|
||||||
cmCustomCommand const& CC;
|
cmCustomCommand const& CC;
|
||||||
std::string Config;
|
std::string Config;
|
||||||
cmMakefile* Makefile;
|
cmLocalGenerator* LG;
|
||||||
bool OldStyle;
|
bool OldStyle;
|
||||||
bool MakeVars;
|
bool MakeVars;
|
||||||
cmGeneratorExpression* GE;
|
cmGeneratorExpression* GE;
|
||||||
@ -31,7 +31,7 @@ class cmCustomCommandGenerator
|
|||||||
public:
|
public:
|
||||||
cmCustomCommandGenerator(cmCustomCommand const& cc,
|
cmCustomCommandGenerator(cmCustomCommand const& cc,
|
||||||
const std::string& config,
|
const std::string& config,
|
||||||
cmMakefile* mf);
|
cmLocalGenerator* lg);
|
||||||
~cmCustomCommandGenerator();
|
~cmCustomCommandGenerator();
|
||||||
cmCustomCommand const& GetCC() const { return this->CC; }
|
cmCustomCommand const& GetCC() const { return this->CC; }
|
||||||
unsigned int GetNumberOfCommands() const;
|
unsigned int GetNumberOfCommands() const;
|
||||||
|
@ -36,10 +36,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
tei = targets.begin();
|
tei = targets.begin();
|
||||||
tei != targets.end(); ++tei)
|
tei != targets.end(); ++tei)
|
||||||
{
|
{
|
||||||
cmTarget *te = this->Makefile->FindTargetToUse(*tei);
|
cmGeneratorTarget *te = this->Makefile
|
||||||
expectedTargets += sep + this->Namespace + te->GetExportName();
|
->FindGeneratorTargetToUse(*tei);
|
||||||
|
expectedTargets += sep + this->Namespace + te->Target->GetExportName();
|
||||||
sep = " ";
|
sep = " ";
|
||||||
if(this->ExportedTargets.insert(te).second)
|
if(this->ExportedTargets.insert(te->Target).second)
|
||||||
{
|
{
|
||||||
this->Exports.push_back(te);
|
this->Exports.push_back(te);
|
||||||
}
|
}
|
||||||
@ -63,11 +64,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
std::vector<std::string> missingTargets;
|
std::vector<std::string> missingTargets;
|
||||||
|
|
||||||
// Create all the imported targets.
|
// Create all the imported targets.
|
||||||
for(std::vector<cmTarget*>::const_iterator
|
for(std::vector<cmGeneratorTarget*>::const_iterator
|
||||||
tei = this->Exports.begin();
|
tei = this->Exports.begin();
|
||||||
tei != this->Exports.end(); ++tei)
|
tei != this->Exports.end(); ++tei)
|
||||||
{
|
{
|
||||||
cmTarget* te = *tei;
|
cmTarget* te = (*tei)->Target;
|
||||||
this->GenerateImportTargetCode(os, te);
|
this->GenerateImportTargetCode(os, te);
|
||||||
|
|
||||||
te->AppendBuildInterfaceIncludes();
|
te->AppendBuildInterfaceIncludes();
|
||||||
@ -129,12 +130,12 @@ cmExportBuildFileGenerator
|
|||||||
std::string const& suffix,
|
std::string const& suffix,
|
||||||
std::vector<std::string> &missingTargets)
|
std::vector<std::string> &missingTargets)
|
||||||
{
|
{
|
||||||
for(std::vector<cmTarget*>::const_iterator
|
for(std::vector<cmGeneratorTarget*>::const_iterator
|
||||||
tei = this->Exports.begin();
|
tei = this->Exports.begin();
|
||||||
tei != this->Exports.end(); ++tei)
|
tei != this->Exports.end(); ++tei)
|
||||||
{
|
{
|
||||||
// Collect import properties for this target.
|
// Collect import properties for this target.
|
||||||
cmTarget* target = *tei;
|
cmGeneratorTarget* target = *tei;
|
||||||
ImportPropertyMap properties;
|
ImportPropertyMap properties;
|
||||||
|
|
||||||
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
|
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
|
||||||
@ -147,10 +148,12 @@ cmExportBuildFileGenerator
|
|||||||
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
|
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
|
||||||
{
|
{
|
||||||
this->SetImportDetailProperties(config, suffix,
|
this->SetImportDetailProperties(config, suffix,
|
||||||
target, properties, missingTargets);
|
target,
|
||||||
|
properties, missingTargets);
|
||||||
this->SetImportLinkInterface(config, suffix,
|
this->SetImportLinkInterface(config, suffix,
|
||||||
cmGeneratorExpression::BuildInterface,
|
cmGeneratorExpression::BuildInterface,
|
||||||
target, properties, missingTargets);
|
target,
|
||||||
|
properties, missingTargets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TOOD: PUBLIC_HEADER_LOCATION
|
// TOOD: PUBLIC_HEADER_LOCATION
|
||||||
@ -160,7 +163,8 @@ cmExportBuildFileGenerator
|
|||||||
// properties);
|
// properties);
|
||||||
|
|
||||||
// Generate code in the export file.
|
// Generate code in the export file.
|
||||||
this->GenerateImportPropertyCode(os, config, target, properties);
|
this->GenerateImportPropertyCode(os, config, target->Target,
|
||||||
|
properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,17 +180,18 @@ void
|
|||||||
cmExportBuildFileGenerator
|
cmExportBuildFileGenerator
|
||||||
::SetImportLocationProperty(const std::string& config,
|
::SetImportLocationProperty(const std::string& config,
|
||||||
std::string const& suffix,
|
std::string const& suffix,
|
||||||
cmTarget* target, ImportPropertyMap& properties)
|
cmGeneratorTarget* target,
|
||||||
|
ImportPropertyMap& properties)
|
||||||
{
|
{
|
||||||
// Get the makefile in which to lookup target information.
|
// Get the makefile in which to lookup target information.
|
||||||
cmMakefile* mf = target->GetMakefile();
|
cmMakefile* mf = target->Makefile;
|
||||||
|
|
||||||
// Add the main target file.
|
// Add the main target file.
|
||||||
{
|
{
|
||||||
std::string prop = "IMPORTED_LOCATION";
|
std::string prop = "IMPORTED_LOCATION";
|
||||||
prop += suffix;
|
prop += suffix;
|
||||||
std::string value;
|
std::string value;
|
||||||
if(target->IsAppBundleOnApple())
|
if(target->Target->IsAppBundleOnApple())
|
||||||
{
|
{
|
||||||
value = target->GetFullPath(config, false);
|
value = target->GetFullPath(config, false);
|
||||||
}
|
}
|
||||||
@ -204,13 +209,13 @@ cmExportBuildFileGenerator
|
|||||||
// Add the import library for windows DLLs.
|
// Add the import library for windows DLLs.
|
||||||
if(dll_platform &&
|
if(dll_platform &&
|
||||||
(target->GetType() == cmTarget::SHARED_LIBRARY ||
|
(target->GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
target->IsExecutableWithExports()) &&
|
target->Target->IsExecutableWithExports()) &&
|
||||||
mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
|
mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX"))
|
||||||
{
|
{
|
||||||
std::string prop = "IMPORTED_IMPLIB";
|
std::string prop = "IMPORTED_IMPLIB";
|
||||||
prop += suffix;
|
prop += suffix;
|
||||||
std::string value = target->GetFullPath(config, true);
|
std::string value = target->GetFullPath(config, true);
|
||||||
target->GetImplibGNUtoMS(value, value,
|
target->Target->GetImplibGNUtoMS(value, value,
|
||||||
"${CMAKE_IMPORT_LIBRARY_SUFFIX}");
|
"${CMAKE_IMPORT_LIBRARY_SUFFIX}");
|
||||||
properties[prop] = value;
|
properties[prop] = value;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ protected:
|
|||||||
/** Fill in properties indicating built file locations. */
|
/** Fill in properties indicating built file locations. */
|
||||||
void SetImportLocationProperty(const std::string& config,
|
void SetImportLocationProperty(const std::string& config,
|
||||||
std::string const& suffix,
|
std::string const& suffix,
|
||||||
cmTarget* target,
|
cmGeneratorTarget* target,
|
||||||
ImportPropertyMap& properties);
|
ImportPropertyMap& properties);
|
||||||
|
|
||||||
std::string InstallNameDir(cmTarget* target, const std::string& config);
|
std::string InstallNameDir(cmTarget* target, const std::string& config);
|
||||||
@ -78,7 +78,7 @@ protected:
|
|||||||
|
|
||||||
std::vector<std::string> Targets;
|
std::vector<std::string> Targets;
|
||||||
cmExportSet *ExportSet;
|
cmExportSet *ExportSet;
|
||||||
std::vector<cmTarget*> Exports;
|
std::vector<cmGeneratorTarget*> Exports;
|
||||||
cmMakefile* Makefile;
|
cmMakefile* Makefile;
|
||||||
cmListFileBacktrace Backtrace;
|
cmListFileBacktrace Backtrace;
|
||||||
};
|
};
|
||||||
|
@ -791,12 +791,13 @@ void
|
|||||||
cmExportFileGenerator
|
cmExportFileGenerator
|
||||||
::SetImportLinkInterface(const std::string& config, std::string const& suffix,
|
::SetImportLinkInterface(const std::string& config, std::string const& suffix,
|
||||||
cmGeneratorExpression::PreprocessContext preprocessRule,
|
cmGeneratorExpression::PreprocessContext preprocessRule,
|
||||||
cmTarget* target, ImportPropertyMap& properties,
|
cmGeneratorTarget* target, ImportPropertyMap& properties,
|
||||||
std::vector<std::string>& missingTargets)
|
std::vector<std::string>& missingTargets)
|
||||||
{
|
{
|
||||||
// Add the transitive link dependencies for this configuration.
|
// Add the transitive link dependencies for this configuration.
|
||||||
cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
|
cmTarget::LinkInterface const* iface = target->Target->GetLinkInterface(
|
||||||
target);
|
config,
|
||||||
|
target->Target);
|
||||||
if (!iface)
|
if (!iface)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -829,12 +830,14 @@ cmExportFileGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool newCMP0022Behavior =
|
const bool newCMP0022Behavior =
|
||||||
target->GetPolicyStatusCMP0022() != cmPolicies::WARN
|
target->Target
|
||||||
&& target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
|
->GetPolicyStatusCMP0022() != cmPolicies::WARN
|
||||||
|
&& target->Target
|
||||||
|
->GetPolicyStatusCMP0022() != cmPolicies::OLD;
|
||||||
|
|
||||||
if(newCMP0022Behavior && !this->ExportOld)
|
if(newCMP0022Behavior && !this->ExportOld)
|
||||||
{
|
{
|
||||||
cmMakefile *mf = target->GetMakefile();
|
cmMakefile *mf = target->Target->GetMakefile();
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
|
e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
|
||||||
"but also has old-style LINK_INTERFACE_LIBRARIES properties "
|
"but also has old-style LINK_INTERFACE_LIBRARIES properties "
|
||||||
@ -854,7 +857,7 @@ cmExportFileGenerator
|
|||||||
preprocessRule);
|
preprocessRule);
|
||||||
if (!prepro.empty())
|
if (!prepro.empty())
|
||||||
{
|
{
|
||||||
this->ResolveTargetsInGeneratorExpressions(prepro, target,
|
this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
|
||||||
missingTargets,
|
missingTargets,
|
||||||
ReplaceFreeTargets);
|
ReplaceFreeTargets);
|
||||||
properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
|
properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = prepro;
|
||||||
@ -866,12 +869,13 @@ void
|
|||||||
cmExportFileGenerator
|
cmExportFileGenerator
|
||||||
::SetImportDetailProperties(const std::string& config,
|
::SetImportDetailProperties(const std::string& config,
|
||||||
std::string const& suffix,
|
std::string const& suffix,
|
||||||
cmTarget* target, ImportPropertyMap& properties,
|
cmGeneratorTarget* target,
|
||||||
|
ImportPropertyMap& properties,
|
||||||
std::vector<std::string>& missingTargets
|
std::vector<std::string>& missingTargets
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Get the makefile in which to lookup target information.
|
// Get the makefile in which to lookup target information.
|
||||||
cmMakefile* mf = target->GetMakefile();
|
cmMakefile* mf = target->Makefile;
|
||||||
|
|
||||||
// Add the soname for unix shared libraries.
|
// Add the soname for unix shared libraries.
|
||||||
if(target->GetType() == cmTarget::SHARED_LIBRARY ||
|
if(target->GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
@ -884,14 +888,14 @@ cmExportFileGenerator
|
|||||||
{
|
{
|
||||||
std::string prop;
|
std::string prop;
|
||||||
std::string value;
|
std::string value;
|
||||||
if(target->HasSOName(config))
|
if(target->Target->HasSOName(config))
|
||||||
{
|
{
|
||||||
if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
|
if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
|
||||||
{
|
{
|
||||||
value = this->InstallNameDir(target, config);
|
value = this->InstallNameDir(target->Target, config);
|
||||||
}
|
}
|
||||||
prop = "IMPORTED_SONAME";
|
prop = "IMPORTED_SONAME";
|
||||||
value += target->GetSOName(config);
|
value += target->Target->GetSOName(config);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -904,8 +908,9 @@ cmExportFileGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the transitive link dependencies for this configuration.
|
// Add the transitive link dependencies for this configuration.
|
||||||
if(cmTarget::LinkInterface const* iface = target->GetLinkInterface(config,
|
if(cmTarget::LinkInterface const* iface =
|
||||||
target))
|
target->Target
|
||||||
|
->GetLinkInterface(config, target->Target))
|
||||||
{
|
{
|
||||||
this->SetImportLinkProperty(suffix, target,
|
this->SetImportLinkProperty(suffix, target,
|
||||||
"IMPORTED_LINK_INTERFACE_LANGUAGES",
|
"IMPORTED_LINK_INTERFACE_LANGUAGES",
|
||||||
@ -931,7 +936,7 @@ template <typename T>
|
|||||||
void
|
void
|
||||||
cmExportFileGenerator
|
cmExportFileGenerator
|
||||||
::SetImportLinkProperty(std::string const& suffix,
|
::SetImportLinkProperty(std::string const& suffix,
|
||||||
cmTarget* target,
|
cmGeneratorTarget* target,
|
||||||
const std::string& propName,
|
const std::string& propName,
|
||||||
std::vector<T> const& entries,
|
std::vector<T> const& entries,
|
||||||
ImportPropertyMap& properties,
|
ImportPropertyMap& properties,
|
||||||
@ -955,7 +960,7 @@ cmExportFileGenerator
|
|||||||
sep = ";";
|
sep = ";";
|
||||||
|
|
||||||
std::string temp = *li;
|
std::string temp = *li;
|
||||||
this->AddTargetNamespace(temp, target, missingTargets);
|
this->AddTargetNamespace(temp, target->Target, missingTargets);
|
||||||
link_entries += temp;
|
link_entries += temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,13 +92,15 @@ protected:
|
|||||||
// Collect properties with detailed information about targets beyond
|
// Collect properties with detailed information about targets beyond
|
||||||
// their location on disk.
|
// their location on disk.
|
||||||
void SetImportDetailProperties(const std::string& config,
|
void SetImportDetailProperties(const std::string& config,
|
||||||
std::string const& suffix, cmTarget* target,
|
std::string const& suffix,
|
||||||
|
cmGeneratorTarget* target,
|
||||||
ImportPropertyMap& properties,
|
ImportPropertyMap& properties,
|
||||||
std::vector<std::string>& missingTargets);
|
std::vector<std::string>& missingTargets);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void SetImportLinkProperty(std::string const& suffix,
|
void SetImportLinkProperty(std::string const& suffix,
|
||||||
cmTarget* target, const std::string& propName,
|
cmGeneratorTarget* target,
|
||||||
|
const std::string& propName,
|
||||||
std::vector<T> const& entries,
|
std::vector<T> const& entries,
|
||||||
ImportPropertyMap& properties,
|
ImportPropertyMap& properties,
|
||||||
std::vector<std::string>& missingTargets);
|
std::vector<std::string>& missingTargets);
|
||||||
@ -148,7 +150,7 @@ protected:
|
|||||||
void SetImportLinkInterface(const std::string& config,
|
void SetImportLinkInterface(const std::string& config,
|
||||||
std::string const& suffix,
|
std::string const& suffix,
|
||||||
cmGeneratorExpression::PreprocessContext preprocessRule,
|
cmGeneratorExpression::PreprocessContext preprocessRule,
|
||||||
cmTarget* target, ImportPropertyMap& properties,
|
cmGeneratorTarget* target, ImportPropertyMap& properties,
|
||||||
std::vector<std::string>& missingTargets);
|
std::vector<std::string>& missingTargets);
|
||||||
|
|
||||||
enum FreeTargetsReplace {
|
enum FreeTargetsReplace {
|
||||||
|
@ -358,12 +358,14 @@ cmExportInstallFileGenerator
|
|||||||
if(!properties.empty())
|
if(!properties.empty())
|
||||||
{
|
{
|
||||||
// Get the rest of the target details.
|
// Get the rest of the target details.
|
||||||
|
cmGeneratorTarget *gtgt = te->Target->GetMakefile()->GetLocalGenerator()
|
||||||
|
->GetGlobalGenerator()->GetGeneratorTarget(te->Target);
|
||||||
this->SetImportDetailProperties(config, suffix,
|
this->SetImportDetailProperties(config, suffix,
|
||||||
te->Target, properties, missingTargets);
|
gtgt, properties, missingTargets);
|
||||||
|
|
||||||
this->SetImportLinkInterface(config, suffix,
|
this->SetImportLinkInterface(config, suffix,
|
||||||
cmGeneratorExpression::InstallInterface,
|
cmGeneratorExpression::InstallInterface,
|
||||||
te->Target, properties, missingTargets);
|
gtgt, properties, missingTargets);
|
||||||
|
|
||||||
// TOOD: PUBLIC_HEADER_LOCATION
|
// TOOD: PUBLIC_HEADER_LOCATION
|
||||||
// This should wait until the build feature propagation stuff
|
// This should wait until the build feature propagation stuff
|
||||||
|
@ -13,9 +13,16 @@
|
|||||||
#include "cmExportTryCompileFileGenerator.h"
|
#include "cmExportTryCompileFileGenerator.h"
|
||||||
|
|
||||||
#include "cmGeneratedFileStream.h"
|
#include "cmGeneratedFileStream.h"
|
||||||
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmGeneratorExpressionDAGChecker.h"
|
#include "cmGeneratorExpressionDAGChecker.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
|
||||||
|
cmGlobalGenerator* gg)
|
||||||
|
{
|
||||||
|
gg->CreateGenerationObjects(cmGlobalGenerator::ImportedOnly);
|
||||||
|
}
|
||||||
|
|
||||||
bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
|
bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
|
||||||
{
|
{
|
||||||
std::set<cmTarget const*> emitted;
|
std::set<cmTarget const*> emitted;
|
||||||
|
@ -20,6 +20,8 @@ class cmInstallTargetGenerator;
|
|||||||
class cmExportTryCompileFileGenerator: public cmExportFileGenerator
|
class cmExportTryCompileFileGenerator: public cmExportFileGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
cmExportTryCompileFileGenerator(cmGlobalGenerator* gg);
|
||||||
|
|
||||||
/** Set the list of targets to export. */
|
/** Set the list of targets to export. */
|
||||||
void SetExports(const std::vector<cmTarget const*> &exports)
|
void SetExports(const std::vector<cmTarget const*> &exports)
|
||||||
{ this->Exports = exports; }
|
{ this->Exports = exports; }
|
||||||
|
@ -591,7 +591,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
location = target->GetLocation(buildType);
|
cmGeneratorTarget* gt =
|
||||||
|
this->GlobalGenerator->GetGeneratorTarget(target);
|
||||||
|
location = gt->GetLocation(buildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
fout<<" <Option output=\"" << location
|
fout<<" <Option output=\"" << location
|
||||||
|
@ -1556,7 +1556,7 @@ class ArtifactDirTag;
|
|||||||
template<typename ArtifactT>
|
template<typename ArtifactT>
|
||||||
struct TargetFilesystemArtifactResultCreator
|
struct TargetFilesystemArtifactResultCreator
|
||||||
{
|
{
|
||||||
static std::string Create(cmTarget* target,
|
static std::string Create(cmGeneratorTarget* target,
|
||||||
cmGeneratorExpressionContext *context,
|
cmGeneratorExpressionContext *context,
|
||||||
const GeneratorExpressionContent *content);
|
const GeneratorExpressionContent *content);
|
||||||
};
|
};
|
||||||
@ -1565,12 +1565,12 @@ struct TargetFilesystemArtifactResultCreator
|
|||||||
template<>
|
template<>
|
||||||
struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
|
struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
|
||||||
{
|
{
|
||||||
static std::string Create(cmTarget* target,
|
static std::string Create(cmGeneratorTarget* target,
|
||||||
cmGeneratorExpressionContext *context,
|
cmGeneratorExpressionContext *context,
|
||||||
const GeneratorExpressionContent *content)
|
const GeneratorExpressionContent *content)
|
||||||
{
|
{
|
||||||
// The target soname file (.so.1).
|
// The target soname file (.so.1).
|
||||||
if(target->IsDLLPlatform())
|
if(target->Target->IsDLLPlatform())
|
||||||
{
|
{
|
||||||
::reportError(context, content->GetOriginalExpression(),
|
::reportError(context, content->GetOriginalExpression(),
|
||||||
"TARGET_SONAME_FILE is not allowed "
|
"TARGET_SONAME_FILE is not allowed "
|
||||||
@ -1584,9 +1584,9 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
|
|||||||
"SHARED libraries.");
|
"SHARED libraries.");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
std::string result = target->GetDirectory(context->Config);
|
std::string result = target->Target->GetDirectory(context->Config);
|
||||||
result += "/";
|
result += "/";
|
||||||
result += target->GetSOName(context->Config);
|
result += target->Target->GetSOName(context->Config);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1595,11 +1595,11 @@ struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
|
|||||||
template<>
|
template<>
|
||||||
struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
|
struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
|
||||||
{
|
{
|
||||||
static std::string Create(cmTarget* target,
|
static std::string Create(cmGeneratorTarget* target,
|
||||||
cmGeneratorExpressionContext *context,
|
cmGeneratorExpressionContext *context,
|
||||||
const GeneratorExpressionContent *content)
|
const GeneratorExpressionContent *content)
|
||||||
{
|
{
|
||||||
std::string language = target->GetLinkerLanguage(context->Config);
|
std::string language = target->Target->GetLinkerLanguage(context->Config);
|
||||||
|
|
||||||
std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
|
std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
|
||||||
|
|
||||||
@ -1610,7 +1610,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTarget::TargetType targetType = target->GetType();
|
cmTarget::TargetType targetType = target->Target->GetType();
|
||||||
|
|
||||||
if(targetType != cmTarget::SHARED_LIBRARY &&
|
if(targetType != cmTarget::SHARED_LIBRARY &&
|
||||||
targetType != cmTarget::MODULE_LIBRARY &&
|
targetType != cmTarget::MODULE_LIBRARY &&
|
||||||
@ -1622,9 +1622,9 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string result = target->GetPDBDirectory(context->Config);
|
std::string result = target->Target->GetPDBDirectory(context->Config);
|
||||||
result += "/";
|
result += "/";
|
||||||
result += target->GetPDBName(context->Config);
|
result += target->Target->GetPDBName(context->Config);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1633,12 +1633,12 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
|
|||||||
template<>
|
template<>
|
||||||
struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
|
struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
|
||||||
{
|
{
|
||||||
static std::string Create(cmTarget* target,
|
static std::string Create(cmGeneratorTarget* target,
|
||||||
cmGeneratorExpressionContext *context,
|
cmGeneratorExpressionContext *context,
|
||||||
const GeneratorExpressionContent *content)
|
const GeneratorExpressionContent *content)
|
||||||
{
|
{
|
||||||
// The file used to link to the target (.so, .lib, .a).
|
// The file used to link to the target (.so, .lib, .a).
|
||||||
if(!target->IsLinkable())
|
if(!target->Target->IsLinkable())
|
||||||
{
|
{
|
||||||
::reportError(context, content->GetOriginalExpression(),
|
::reportError(context, content->GetOriginalExpression(),
|
||||||
"TARGET_LINKER_FILE is allowed only for libraries and "
|
"TARGET_LINKER_FILE is allowed only for libraries and "
|
||||||
@ -1646,7 +1646,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
return target->GetFullPath(context->Config,
|
return target->GetFullPath(context->Config,
|
||||||
target->HasImportLibrary());
|
target->Target->HasImportLibrary());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1654,7 +1654,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
|
|||||||
template<>
|
template<>
|
||||||
struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
|
struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
|
||||||
{
|
{
|
||||||
static std::string Create(cmTarget* target,
|
static std::string Create(cmGeneratorTarget* target,
|
||||||
cmGeneratorExpressionContext *context,
|
cmGeneratorExpressionContext *context,
|
||||||
const GeneratorExpressionContent *)
|
const GeneratorExpressionContent *)
|
||||||
{
|
{
|
||||||
@ -1716,7 +1716,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
|
|||||||
"Expression syntax not recognized.");
|
"Expression syntax not recognized.");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
cmTarget* target = context->Makefile->FindTargetToUse(name);
|
cmGeneratorTarget* target =
|
||||||
|
context->Makefile->FindGeneratorTargetToUse(name);
|
||||||
if(!target)
|
if(!target)
|
||||||
{
|
{
|
||||||
::reportError(context, content->GetOriginalExpression(),
|
::reportError(context, content->GetOriginalExpression(),
|
||||||
@ -1739,8 +1740,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
|
|||||||
"be used while evaluating link libraries");
|
"be used while evaluating link libraries");
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
context->DependTargets.insert(target);
|
context->DependTargets.insert(target->Target);
|
||||||
context->AllTargets.insert(target);
|
context->AllTargets.insert(target->Target);
|
||||||
|
|
||||||
std::string result =
|
std::string result =
|
||||||
TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
|
TargetFilesystemArtifactResultCreator<ArtifactT>::Create(
|
||||||
|
@ -519,6 +519,61 @@ void cmGeneratorTarget
|
|||||||
srcs = data.XamlSources;
|
srcs = data.XamlSources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
const char* cmGeneratorTarget::GetLocation(const std::string& config) const
|
||||||
|
{
|
||||||
|
static std::string location;
|
||||||
|
if (this->Target->IsImported())
|
||||||
|
{
|
||||||
|
location = this->Target->ImportedGetFullPath(config, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
location = this->GetFullPath(config, false);
|
||||||
|
}
|
||||||
|
return location.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cmGeneratorTarget::IsImported() const
|
||||||
|
{
|
||||||
|
return this->Target->IsImported();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
const char* cmGeneratorTarget::GetLocationForBuild() const
|
||||||
|
{
|
||||||
|
static std::string location;
|
||||||
|
if(this->IsImported())
|
||||||
|
{
|
||||||
|
location = this->Target->ImportedGetFullPath("", false);
|
||||||
|
return location.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now handle the deprecated build-time configuration location.
|
||||||
|
location = this->Target->GetDirectory();
|
||||||
|
const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
|
||||||
|
if(cfgid && strcmp(cfgid, ".") != 0)
|
||||||
|
{
|
||||||
|
location += "/";
|
||||||
|
location += cfgid;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this->Target->IsAppBundleOnApple())
|
||||||
|
{
|
||||||
|
std::string macdir = this->Target->BuildMacContentDirectory("", "",
|
||||||
|
false);
|
||||||
|
if(!macdir.empty())
|
||||||
|
{
|
||||||
|
location += "/";
|
||||||
|
location += macdir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
location += "/";
|
||||||
|
location += this->Target->GetFullName("", false);
|
||||||
|
return location.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
|
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
|
||||||
const std::string& config) const
|
const std::string& config) const
|
||||||
@ -834,7 +889,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for a target with this name.
|
// Check for a target with this name.
|
||||||
if(cmTarget* t = this->Makefile->FindTargetToUse(util))
|
if(cmGeneratorTarget* t
|
||||||
|
= this->Makefile->FindGeneratorTargetToUse(util))
|
||||||
{
|
{
|
||||||
// If we find the target and the dep was given as a full path,
|
// If we find the target and the dep was given as a full path,
|
||||||
// then make sure it was not a full path to something else, and
|
// then make sure it was not a full path to something else, and
|
||||||
@ -938,7 +994,8 @@ void cmTargetTraceDependencies::FollowCommandDepends(cmCustomCommand const& cc,
|
|||||||
const std::string& config,
|
const std::string& config,
|
||||||
std::set<std::string>& emitted)
|
std::set<std::string>& emitted)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(cc, config, this->Makefile);
|
cmCustomCommandGenerator ccg(cc, config,
|
||||||
|
this->GeneratorTarget->LocalGenerator);
|
||||||
|
|
||||||
const std::vector<std::string>& depends = ccg.GetDepends();
|
const std::vector<std::string>& depends = ccg.GetDepends();
|
||||||
|
|
||||||
@ -1125,6 +1182,86 @@ void cmGeneratorTarget::GenerateTargetManifest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string cmGeneratorTarget::GetFullPath(const std::string& config,
|
||||||
|
bool implib, bool realname) const
|
||||||
|
{
|
||||||
|
if(this->Target->IsImported())
|
||||||
|
{
|
||||||
|
return this->Target->ImportedGetFullPath(config, implib);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this->NormalGetFullPath(config, implib, realname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
|
||||||
|
bool implib,
|
||||||
|
bool realname) const
|
||||||
|
{
|
||||||
|
std::string fpath = this->Target->GetDirectory(config, implib);
|
||||||
|
fpath += "/";
|
||||||
|
if(this->Target->IsAppBundleOnApple())
|
||||||
|
{
|
||||||
|
fpath = this->Target->BuildMacContentDirectory(fpath, config, false);
|
||||||
|
fpath += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the full name of the target.
|
||||||
|
if(implib)
|
||||||
|
{
|
||||||
|
fpath += this->Target->GetFullName(config, true);
|
||||||
|
}
|
||||||
|
else if(realname)
|
||||||
|
{
|
||||||
|
fpath += this->NormalGetRealName(config);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fpath += this->Target->GetFullName(config, false);
|
||||||
|
}
|
||||||
|
return fpath;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string
|
||||||
|
cmGeneratorTarget::NormalGetRealName(const std::string& config) const
|
||||||
|
{
|
||||||
|
// This should not be called for imported targets.
|
||||||
|
// TODO: Split cmTarget into a class hierarchy to get compile-time
|
||||||
|
// enforcement of the limited imported target API.
|
||||||
|
if(this->Target->IsImported())
|
||||||
|
{
|
||||||
|
std::string msg = "NormalGetRealName called on imported target: ";
|
||||||
|
msg += this->GetName();
|
||||||
|
this->Makefile->IssueMessage(cmake::INTERNAL_ERROR, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this->GetType() == cmTarget::EXECUTABLE)
|
||||||
|
{
|
||||||
|
// Compute the real name that will be built.
|
||||||
|
std::string name;
|
||||||
|
std::string realName;
|
||||||
|
std::string impName;
|
||||||
|
std::string pdbName;
|
||||||
|
this->Target->GetExecutableNames(name, realName, impName, pdbName, config);
|
||||||
|
return realName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Compute the real name that will be built.
|
||||||
|
std::string name;
|
||||||
|
std::string soName;
|
||||||
|
std::string realName;
|
||||||
|
std::string impName;
|
||||||
|
std::string pdbName;
|
||||||
|
this->Target->GetLibraryNames(name, soName, realName,
|
||||||
|
impName, pdbName, config);
|
||||||
|
return realName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool cmStrictTargetComparison::operator()(cmTarget const* t1,
|
bool cmStrictTargetComparison::operator()(cmTarget const* t1,
|
||||||
cmTarget const* t2) const
|
cmTarget const* t2) const
|
||||||
{
|
{
|
||||||
|
@ -28,6 +28,14 @@ public:
|
|||||||
|
|
||||||
cmLocalGenerator* GetLocalGenerator() const;
|
cmLocalGenerator* GetLocalGenerator() const;
|
||||||
|
|
||||||
|
bool IsImported() const;
|
||||||
|
const char *GetLocation(const std::string& config) const;
|
||||||
|
|
||||||
|
/** Get the location of the target in the build tree with a placeholder
|
||||||
|
referencing the configuration in the native build system. This
|
||||||
|
location is suitable for use as the LOCATION target property. */
|
||||||
|
const char* GetLocationForBuild() const;
|
||||||
|
|
||||||
int GetType() const;
|
int GetType() const;
|
||||||
std::string GetName() const;
|
std::string GetName() const;
|
||||||
const char *GetProperty(const std::string& prop) const;
|
const char *GetProperty(const std::string& prop) const;
|
||||||
@ -74,6 +82,14 @@ public:
|
|||||||
bool GetFeatureAsBool(const std::string& feature,
|
bool GetFeatureAsBool(const std::string& feature,
|
||||||
const std::string& config) const;
|
const std::string& config) const;
|
||||||
|
|
||||||
|
/** Get the full path to the target according to the settings in its
|
||||||
|
makefile and the configuration type. */
|
||||||
|
std::string GetFullPath(const std::string& config="", bool implib = false,
|
||||||
|
bool realname = false) const;
|
||||||
|
std::string NormalGetFullPath(const std::string& config, bool implib,
|
||||||
|
bool realname) const;
|
||||||
|
std::string NormalGetRealName(const std::string& config) const;
|
||||||
|
|
||||||
cmTarget* Target;
|
cmTarget* Target;
|
||||||
cmMakefile* Makefile;
|
cmMakefile* Makefile;
|
||||||
cmLocalGenerator* LocalGenerator;
|
cmLocalGenerator* LocalGenerator;
|
||||||
|
@ -1149,6 +1149,32 @@ void cmGlobalGenerator::Configure()
|
|||||||
}
|
}
|
||||||
this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1);
|
this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
// Put a copy of each global target in every directory.
|
||||||
|
cmTargets globalTargets;
|
||||||
|
this->CreateDefaultGlobalTargets(&globalTargets);
|
||||||
|
|
||||||
|
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
|
{
|
||||||
|
cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
|
||||||
|
cmTargets* targets = &(mf->GetTargets());
|
||||||
|
cmTargets::iterator tit;
|
||||||
|
for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
|
||||||
|
{
|
||||||
|
(*targets)[tit->first] = tit->second;
|
||||||
|
(*targets)[tit->first].SetMakefile(mf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
|
||||||
|
{
|
||||||
|
cmDeleteAll(this->GeneratorTargets);
|
||||||
|
this->GeneratorTargets.clear();
|
||||||
|
this->CreateGeneratorTargets(targetTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
cmExportBuildFileGenerator*
|
cmExportBuildFileGenerator*
|
||||||
@ -1208,6 +1234,8 @@ void cmGlobalGenerator::Generate()
|
|||||||
|
|
||||||
this->FinalizeTargetCompileInfo();
|
this->FinalizeTargetCompileInfo();
|
||||||
|
|
||||||
|
this->CreateGenerationObjects();
|
||||||
|
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
// Iterate through all targets and set up automoc for those which have
|
// Iterate through all targets and set up automoc for those which have
|
||||||
// the AUTOMOC, AUTOUIC or AUTORCC property set
|
// the AUTOMOC, AUTOUIC or AUTORCC property set
|
||||||
@ -1215,23 +1243,11 @@ void cmGlobalGenerator::Generate()
|
|||||||
this->CreateQtAutoGeneratorsTargets(autogens);
|
this->CreateQtAutoGeneratorsTargets(autogens);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For each existing cmLocalGenerator
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
// Put a copy of each global target in every directory.
|
|
||||||
cmTargets globalTargets;
|
|
||||||
this->CreateDefaultGlobalTargets(&globalTargets);
|
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
this->LocalGenerators[i]->ComputeObjectMaxPath();
|
this->LocalGenerators[i]->ComputeObjectMaxPath();
|
||||||
cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
|
|
||||||
cmTargets* targets = &(mf->GetTargets());
|
|
||||||
cmTargets::iterator tit;
|
|
||||||
for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
|
|
||||||
{
|
|
||||||
(*targets)[tit->first] = tit->second;
|
|
||||||
(*targets)[tit->first].SetMakefile(mf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add generator specific helper commands
|
// Add generator specific helper commands
|
||||||
@ -1240,8 +1256,7 @@ void cmGlobalGenerator::Generate()
|
|||||||
this->LocalGenerators[i]->AddHelperCommands();
|
this->LocalGenerators[i]->AddHelperCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create per-target generator information.
|
this->InitGeneratorTargets();
|
||||||
this->CreateGeneratorTargets();
|
|
||||||
|
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
|
for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
|
||||||
@ -1377,6 +1392,10 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
|
|||||||
for(cmTargets::iterator ti = targets.begin();
|
for(cmTargets::iterator ti = targets.begin();
|
||||||
ti != targets.end(); ++ti)
|
ti != targets.end(); ++ti)
|
||||||
{
|
{
|
||||||
|
if (ti->second.GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
targetNames.push_back(ti->second.GetName());
|
targetNames.push_back(ti->second.GetName());
|
||||||
}
|
}
|
||||||
for(std::vector<std::string>::iterator ti = targetNames.begin();
|
for(std::vector<std::string>::iterator ti = targetNames.begin();
|
||||||
@ -1396,7 +1415,8 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
|
|||||||
&& !target.IsImported())
|
&& !target.IsImported())
|
||||||
{
|
{
|
||||||
cmQtAutoGenerators autogen;
|
cmQtAutoGenerators autogen;
|
||||||
if(autogen.InitializeAutogenTarget(&target))
|
if(autogen.InitializeAutogenTarget(this->LocalGenerators[i],
|
||||||
|
&target))
|
||||||
{
|
{
|
||||||
autogens.push_back(std::make_pair(autogen, &target));
|
autogens.push_back(std::make_pair(autogen, &target));
|
||||||
}
|
}
|
||||||
@ -1427,6 +1447,10 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
|
|||||||
ti != targets.end(); ++ti)
|
ti != targets.end(); ++ti)
|
||||||
{
|
{
|
||||||
cmTarget* t = &ti->second;
|
cmTarget* t = &ti->second;
|
||||||
|
if (t->GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
t->AppendBuildInterfaceIncludes();
|
t->AppendBuildInterfaceIncludes();
|
||||||
|
|
||||||
@ -1465,19 +1489,22 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
|
void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
|
||||||
|
cmLocalGenerator *lg)
|
||||||
{
|
{
|
||||||
cmGeneratorTargetsType generatorTargets;
|
cmGeneratorTargetsType generatorTargets;
|
||||||
cmMakefile* mf = lg->GetMakefile();
|
cmMakefile* mf = lg->GetMakefile();
|
||||||
cmTargets& targets = mf->GetTargets();
|
if (targetTypes == AllTargets)
|
||||||
for(cmTargets::iterator ti = targets.begin();
|
|
||||||
ti != targets.end(); ++ti)
|
|
||||||
{
|
{
|
||||||
cmTarget* t = &ti->second;
|
cmTargets& targets = mf->GetTargets();
|
||||||
cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
|
for(cmTargets::iterator ti = targets.begin();
|
||||||
this->ComputeTargetObjectDirectory(gt);
|
ti != targets.end(); ++ti)
|
||||||
this->GeneratorTargets[t] = gt;
|
{
|
||||||
generatorTargets[t] = gt;
|
cmTarget* t = &ti->second;
|
||||||
|
cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
|
||||||
|
this->GeneratorTargets[t] = gt;
|
||||||
|
generatorTargets[t] = gt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(std::vector<cmTarget*>::const_iterator
|
for(std::vector<cmTarget*>::const_iterator
|
||||||
@ -1492,12 +1519,25 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmLocalGenerator *lg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalGenerator::CreateGeneratorTargets()
|
void cmGlobalGenerator::InitGeneratorTargets()
|
||||||
|
{
|
||||||
|
for(cmGeneratorTargetsType::iterator ti =
|
||||||
|
this->GeneratorTargets.begin(); ti != this->GeneratorTargets.end(); ++ti)
|
||||||
|
{
|
||||||
|
if (!ti->second->Target->IsImported())
|
||||||
|
{
|
||||||
|
this->ComputeTargetObjectDirectory(ti->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes)
|
||||||
{
|
{
|
||||||
// Construct per-target generator information.
|
// Construct per-target generator information.
|
||||||
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
|
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
this->CreateGeneratorTargets(this->LocalGenerators[i]);
|
this->CreateGeneratorTargets(targetTypes, this->LocalGenerators[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3054,7 +3094,8 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
|
|||||||
cmake::InstalledFilesMap const& installedFiles =
|
cmake::InstalledFilesMap const& installedFiles =
|
||||||
this->CMakeInstance->GetInstalledFiles();
|
this->CMakeInstance->GetInstalledFiles();
|
||||||
|
|
||||||
cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
|
cmLocalGenerator* lg = this->LocalGenerators[0];
|
||||||
|
cmMakefile* mf = lg->GetMakefile();
|
||||||
|
|
||||||
std::vector<std::string> configs;
|
std::vector<std::string> configs;
|
||||||
std::string config = mf->GetConfigurations(configs, false);
|
std::string config = mf->GetConfigurations(configs, false);
|
||||||
@ -3076,7 +3117,7 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
|
|||||||
cmInstalledFile const& installedFile = i->second;
|
cmInstalledFile const& installedFile = i->second;
|
||||||
|
|
||||||
cmCPackPropertiesGenerator cpackPropertiesGenerator(
|
cmCPackPropertiesGenerator cpackPropertiesGenerator(
|
||||||
mf, installedFile, configs);
|
lg, installedFile, configs);
|
||||||
|
|
||||||
cpackPropertiesGenerator.Generate(file, config, configs);
|
cpackPropertiesGenerator.Generate(file, config, configs);
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void Configure();
|
virtual void Configure();
|
||||||
|
|
||||||
|
|
||||||
|
enum TargetTypes {
|
||||||
|
AllTargets,
|
||||||
|
ImportedOnly
|
||||||
|
};
|
||||||
|
|
||||||
|
void CreateGenerationObjects(TargetTypes targetTypes = AllTargets);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
* basically creates a series of LocalGenerators for each directory and
|
* basically creates a series of LocalGenerators for each directory and
|
||||||
@ -298,6 +306,11 @@ public:
|
|||||||
/** Get per-target generator information. */
|
/** Get per-target generator information. */
|
||||||
cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
|
cmGeneratorTarget* GetGeneratorTarget(cmTarget const*) const;
|
||||||
|
|
||||||
|
void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
|
||||||
|
{
|
||||||
|
this->GeneratorTargets[t] = gt;
|
||||||
|
}
|
||||||
|
|
||||||
const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
|
const std::map<std::string, std::vector<cmLocalGenerator*> >& GetProjectMap()
|
||||||
const {return this->ProjectMap;}
|
const {return this->ProjectMap;}
|
||||||
|
|
||||||
@ -484,8 +497,9 @@ private:
|
|||||||
// Per-target generator information.
|
// Per-target generator information.
|
||||||
cmGeneratorTargetsType GeneratorTargets;
|
cmGeneratorTargetsType GeneratorTargets;
|
||||||
friend class cmake;
|
friend class cmake;
|
||||||
void CreateGeneratorTargets(cmLocalGenerator* lg);
|
void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg);
|
||||||
void CreateGeneratorTargets();
|
void InitGeneratorTargets();
|
||||||
|
void CreateGeneratorTargets(TargetTypes targetTypes);
|
||||||
|
|
||||||
void ClearGeneratorMembers();
|
void ClearGeneratorMembers();
|
||||||
|
|
||||||
|
@ -70,13 +70,13 @@ void cmGlobalKdevelopGenerator::Generate()
|
|||||||
lg!=lgs.end(); lg++)
|
lg!=lgs.end(); lg++)
|
||||||
{
|
{
|
||||||
cmMakefile* makefile=(*lg)->GetMakefile();
|
cmMakefile* makefile=(*lg)->GetMakefile();
|
||||||
cmTargets& targets=makefile->GetTargets();
|
cmGeneratorTargetsType const& targets = makefile->GetGeneratorTargets();
|
||||||
for (cmTargets::iterator ti = targets.begin();
|
for (cmGeneratorTargetsType::const_iterator ti = targets.begin();
|
||||||
ti != targets.end(); ti++)
|
ti != targets.end(); ti++)
|
||||||
{
|
{
|
||||||
if (ti->second.GetType()==cmTarget::EXECUTABLE)
|
if (ti->second->GetType()==cmTarget::EXECUTABLE)
|
||||||
{
|
{
|
||||||
executable = ti->second.GetLocation("");
|
executable = ti->second->GetLocation("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -910,10 +910,14 @@ cmGlobalNinjaGenerator
|
|||||||
case cmTarget::SHARED_LIBRARY:
|
case cmTarget::SHARED_LIBRARY:
|
||||||
case cmTarget::STATIC_LIBRARY:
|
case cmTarget::STATIC_LIBRARY:
|
||||||
case cmTarget::MODULE_LIBRARY:
|
case cmTarget::MODULE_LIBRARY:
|
||||||
|
{
|
||||||
|
cmGeneratorTarget *gtgt = target->GetMakefile()->GetLocalGenerator()
|
||||||
|
->GetGlobalGenerator()
|
||||||
|
->GetGeneratorTarget(target);
|
||||||
outputs.push_back(ng->ConvertToNinjaPath(
|
outputs.push_back(ng->ConvertToNinjaPath(
|
||||||
target->GetFullPath(configName, false, realname)));
|
gtgt->GetFullPath(configName, false, realname)));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case cmTarget::OBJECT_LIBRARY:
|
case cmTarget::OBJECT_LIBRARY:
|
||||||
case cmTarget::UTILITY: {
|
case cmTarget::UTILITY: {
|
||||||
std::string path = ng->ConvertToNinjaPath(
|
std::string path = ng->ConvertToNinjaPath(
|
||||||
|
@ -1668,7 +1668,7 @@ void cmGlobalXCodeGenerator
|
|||||||
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
||||||
i != commands.end(); ++i)
|
i != commands.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*i, configName, this->CurrentMakefile);
|
cmCustomCommandGenerator ccg(*i, configName, this->CurrentLocalGenerator);
|
||||||
if(ccg.GetNumberOfCommands() > 0)
|
if(ccg.GetNumberOfCommands() > 0)
|
||||||
{
|
{
|
||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
@ -1694,7 +1694,7 @@ void cmGlobalXCodeGenerator
|
|||||||
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
||||||
i != commands.end(); ++i)
|
i != commands.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*i, configName, this->CurrentMakefile);
|
cmCustomCommandGenerator ccg(*i, configName, this->CurrentLocalGenerator);
|
||||||
if(ccg.GetNumberOfCommands() > 0)
|
if(ccg.GetNumberOfCommands() > 0)
|
||||||
{
|
{
|
||||||
makefileStream << "\n";
|
makefileStream << "\n";
|
||||||
@ -3598,6 +3598,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
|||||||
{
|
{
|
||||||
cmXCodeObject* target = *i;
|
cmXCodeObject* target = *i;
|
||||||
cmTarget* t =target->GetTarget();
|
cmTarget* t =target->GetTarget();
|
||||||
|
cmGeneratorTarget *gt = this->GetGeneratorTarget(t);
|
||||||
|
|
||||||
if(t->GetType() == cmTarget::EXECUTABLE ||
|
if(t->GetType() == cmTarget::EXECUTABLE ||
|
||||||
// Nope - no post-build for OBJECT_LIRBRARY
|
// Nope - no post-build for OBJECT_LIRBRARY
|
||||||
@ -3615,7 +3616,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
|
|||||||
t->GetType() == cmTarget::SHARED_LIBRARY ||
|
t->GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
t->GetType() == cmTarget::MODULE_LIBRARY)
|
t->GetType() == cmTarget::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
std::string tfull = t->GetFullPath(configName);
|
std::string tfull = gt->GetFullPath(configName);
|
||||||
std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
|
std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
|
||||||
|
|
||||||
// Add this target to the post-build phases of its dependencies.
|
// Add this target to the post-build phases of its dependencies.
|
||||||
|
@ -125,6 +125,7 @@ bool cmIncludeCommand
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gg->CreateGenerationObjects();
|
||||||
gg->GenerateImportFile(fname_abs);
|
gg->GenerateImportFile(fname_abs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,226 +448,6 @@ cmState::Snapshot cmLocalGenerator::GetStateSnapshot() const
|
|||||||
return this->StateSnapshot;
|
return this->StateSnapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
|
|
||||||
const std::string& lang,
|
|
||||||
cmSourceFile& source,
|
|
||||||
cmGeneratorTarget& target)
|
|
||||||
{
|
|
||||||
std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
|
|
||||||
objectDir = this->Convert(objectDir,START_OUTPUT,SHELL);
|
|
||||||
std::string objectFile = this->Convert(ofname,START_OUTPUT,SHELL);
|
|
||||||
std::string sourceFile =
|
|
||||||
this->ConvertToOutputFormat(source.GetFullPath(), SHELL);
|
|
||||||
std::string varString = "CMAKE_";
|
|
||||||
varString += lang;
|
|
||||||
varString += "_COMPILE_OBJECT";
|
|
||||||
std::vector<std::string> rules;
|
|
||||||
rules.push_back(this->Makefile->GetRequiredDefinition(varString));
|
|
||||||
varString = "CMAKE_";
|
|
||||||
varString += lang;
|
|
||||||
varString += "_FLAGS";
|
|
||||||
std::string flags;
|
|
||||||
flags += this->Makefile->GetSafeDefinition(varString);
|
|
||||||
flags += " ";
|
|
||||||
{
|
|
||||||
std::vector<std::string> includes;
|
|
||||||
this->GetIncludeDirectories(includes, &target, lang);
|
|
||||||
flags += this->GetIncludeFlags(includes, &target, lang);
|
|
||||||
}
|
|
||||||
flags += this->Makefile->GetDefineFlags();
|
|
||||||
|
|
||||||
// Construct the command lines.
|
|
||||||
cmCustomCommandLines commandLines;
|
|
||||||
std::vector<std::string> commands;
|
|
||||||
cmSystemTools::ExpandList(rules, commands);
|
|
||||||
cmLocalGenerator::RuleVariables vars;
|
|
||||||
vars.Language = lang.c_str();
|
|
||||||
vars.Source = sourceFile.c_str();
|
|
||||||
vars.Object = objectFile.c_str();
|
|
||||||
vars.ObjectDir = objectDir.c_str();
|
|
||||||
vars.Flags = flags.c_str();
|
|
||||||
for(std::vector<std::string>::iterator i = commands.begin();
|
|
||||||
i != commands.end(); ++i)
|
|
||||||
{
|
|
||||||
// Expand the full command line string.
|
|
||||||
this->ExpandRuleVariables(*i, vars);
|
|
||||||
|
|
||||||
// Parse the string to get the custom command line.
|
|
||||||
cmCustomCommandLine commandLine;
|
|
||||||
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
|
|
||||||
commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
|
|
||||||
|
|
||||||
// Store this command line.
|
|
||||||
commandLines.push_back(commandLine);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for extra object-file dependencies.
|
|
||||||
std::vector<std::string> depends;
|
|
||||||
const char* additionalDeps = source.GetProperty("OBJECT_DEPENDS");
|
|
||||||
if(additionalDeps)
|
|
||||||
{
|
|
||||||
cmSystemTools::ExpandListArgument(additionalDeps, depends);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate a meaningful comment for the command.
|
|
||||||
std::string comment = "Building ";
|
|
||||||
comment += lang;
|
|
||||||
comment += " object ";
|
|
||||||
comment += this->Convert(ofname, START_OUTPUT);
|
|
||||||
|
|
||||||
// Add the custom command to build the object file.
|
|
||||||
this->Makefile->AddCustomCommandToOutput(
|
|
||||||
ofname,
|
|
||||||
depends,
|
|
||||||
source.GetFullPath(),
|
|
||||||
commandLines,
|
|
||||||
comment.c_str(),
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
|
|
||||||
cmGeneratorTarget& target)
|
|
||||||
{
|
|
||||||
std::string objs;
|
|
||||||
std::vector<std::string> objVector;
|
|
||||||
std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
|
||||||
// Add all the sources outputs to the depends of the target
|
|
||||||
std::vector<cmSourceFile*> classes;
|
|
||||||
target.GetSourceFiles(classes, config);
|
|
||||||
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
|
|
||||||
i != classes.end(); ++i)
|
|
||||||
{
|
|
||||||
cmSourceFile* sf = *i;
|
|
||||||
if(!sf->GetCustomCommand() &&
|
|
||||||
!sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
|
|
||||||
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
|
|
||||||
{
|
|
||||||
std::string dir_max;
|
|
||||||
dir_max += this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
|
||||||
dir_max += "/";
|
|
||||||
std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
|
|
||||||
if(!obj.empty())
|
|
||||||
{
|
|
||||||
std::string ofname =
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary();
|
|
||||||
ofname += "/";
|
|
||||||
ofname += obj;
|
|
||||||
objVector.push_back(ofname);
|
|
||||||
this->AddCustomCommandToCreateObject(ofname.c_str(),
|
|
||||||
llang, *(*i), target);
|
|
||||||
objs += this->Convert(ofname,START_OUTPUT,SHELL);
|
|
||||||
objs += " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::string createRule = target.GetCreateRuleVariable(llang, config);
|
|
||||||
bool useWatcomQuote = this->Makefile->IsOn(createRule+"_USE_WATCOM_QUOTE");
|
|
||||||
std::string targetName = target.Target->GetFullName();
|
|
||||||
// Executable :
|
|
||||||
// Shared Library:
|
|
||||||
// Static Library:
|
|
||||||
// Shared Module:
|
|
||||||
std::string linkLibs; // should be set
|
|
||||||
std::string frameworkPath;
|
|
||||||
std::string linkPath;
|
|
||||||
std::string flags; // should be set
|
|
||||||
std::string linkFlags; // should be set
|
|
||||||
this->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
|
|
||||||
&target, useWatcomQuote);
|
|
||||||
linkLibs = frameworkPath + linkPath + linkLibs;
|
|
||||||
cmLocalGenerator::RuleVariables vars;
|
|
||||||
vars.Language = llang.c_str();
|
|
||||||
vars.Objects = objs.c_str();
|
|
||||||
vars.ObjectDir = ".";
|
|
||||||
vars.Target = targetName.c_str();
|
|
||||||
vars.LinkLibraries = linkLibs.c_str();
|
|
||||||
vars.Flags = flags.c_str();
|
|
||||||
vars.LinkFlags = linkFlags.c_str();
|
|
||||||
|
|
||||||
std::string langFlags;
|
|
||||||
this->AddLanguageFlags(langFlags, llang, "");
|
|
||||||
this->AddArchitectureFlags(langFlags, &target, llang, "");
|
|
||||||
vars.LanguageCompileFlags = langFlags.c_str();
|
|
||||||
|
|
||||||
cmCustomCommandLines commandLines;
|
|
||||||
std::vector<std::string> rules;
|
|
||||||
rules.push_back(this->Makefile->GetRequiredDefinition(createRule));
|
|
||||||
std::vector<std::string> commands;
|
|
||||||
cmSystemTools::ExpandList(rules, commands);
|
|
||||||
for(std::vector<std::string>::iterator i = commands.begin();
|
|
||||||
i != commands.end(); ++i)
|
|
||||||
{
|
|
||||||
// Expand the full command line string.
|
|
||||||
this->ExpandRuleVariables(*i, vars);
|
|
||||||
// Parse the string to get the custom command line.
|
|
||||||
cmCustomCommandLine commandLine;
|
|
||||||
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
|
|
||||||
commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
|
|
||||||
|
|
||||||
// Store this command line.
|
|
||||||
commandLines.push_back(commandLine);
|
|
||||||
}
|
|
||||||
std::string targetFullPath = target.Target->GetFullPath();
|
|
||||||
// Generate a meaningful comment for the command.
|
|
||||||
std::string comment = "Linking ";
|
|
||||||
comment += llang;
|
|
||||||
comment += " target ";
|
|
||||||
comment += this->Convert(targetFullPath, START_OUTPUT);
|
|
||||||
this->Makefile->AddCustomCommandToOutput(
|
|
||||||
targetFullPath,
|
|
||||||
objVector,
|
|
||||||
"",
|
|
||||||
commandLines,
|
|
||||||
comment.c_str(),
|
|
||||||
this->StateSnapshot.GetDirectory().GetCurrentBinary()
|
|
||||||
);
|
|
||||||
this->Makefile->GetSource(targetFullPath);
|
|
||||||
target.Target->AddSource(targetFullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void cmLocalGenerator
|
|
||||||
::CreateCustomTargetsAndCommands(std::set<std::string> const& lang)
|
|
||||||
{
|
|
||||||
cmGeneratorTargetsType tgts = this->Makefile->GetGeneratorTargets();
|
|
||||||
for(cmGeneratorTargetsType::iterator l = tgts.begin();
|
|
||||||
l != tgts.end(); l++)
|
|
||||||
{
|
|
||||||
if (l->first->IsImported())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
cmGeneratorTarget& target = *l->second;
|
|
||||||
switch(target.GetType())
|
|
||||||
{
|
|
||||||
case cmTarget::STATIC_LIBRARY:
|
|
||||||
case cmTarget::SHARED_LIBRARY:
|
|
||||||
case cmTarget::MODULE_LIBRARY:
|
|
||||||
case cmTarget::EXECUTABLE:
|
|
||||||
{
|
|
||||||
std::string llang = target.Target->GetLinkerLanguage();
|
|
||||||
if(llang.empty())
|
|
||||||
{
|
|
||||||
cmSystemTools::Error
|
|
||||||
("CMake can not determine linker language for target: ",
|
|
||||||
target.Target->GetName().c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// if the language is not in the set lang then create custom
|
|
||||||
// commands to build the target
|
|
||||||
if(lang.count(llang) == 0)
|
|
||||||
{
|
|
||||||
this->AddBuildTargetRule(llang, target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// List of variables that are replaced when
|
// List of variables that are replaced when
|
||||||
// rules are expanced. These variables are
|
// rules are expanced. These variables are
|
||||||
// replaced in the form <var> with GetSafeDefinition(var).
|
// replaced in the form <var> with GetSafeDefinition(var).
|
||||||
@ -1919,7 +1699,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look for a CMake target with the given name.
|
// Look for a CMake target with the given name.
|
||||||
if(cmTarget* target = this->Makefile->FindTargetToUse(name))
|
if(cmGeneratorTarget* target =
|
||||||
|
this->Makefile->FindGeneratorTargetToUse(name))
|
||||||
{
|
{
|
||||||
// make sure it is not just a coincidence that the target name
|
// make sure it is not just a coincidence that the target name
|
||||||
// found is part of the inName
|
// found is part of the inName
|
||||||
|
@ -328,23 +328,6 @@ protected:
|
|||||||
void InsertRuleLauncher(std::string& s, cmTarget* target,
|
void InsertRuleLauncher(std::string& s, cmTarget* target,
|
||||||
const std::string& prop);
|
const std::string& prop);
|
||||||
|
|
||||||
|
|
||||||
/** Convert a target to a utility target for unsupported
|
|
||||||
* languages of a generator */
|
|
||||||
void AddBuildTargetRule(const std::string& llang,
|
|
||||||
cmGeneratorTarget& target);
|
|
||||||
///! add a custom command to build a .o file that is part of a target
|
|
||||||
void AddCustomCommandToCreateObject(const char* ofname,
|
|
||||||
const std::string& lang,
|
|
||||||
cmSourceFile& source,
|
|
||||||
cmGeneratorTarget& target);
|
|
||||||
// Create Custom Targets and commands for unsupported languages
|
|
||||||
// The set passed in should contain the languages supported by the
|
|
||||||
// generator directly. Any targets containing files that are not
|
|
||||||
// of the types listed will be compiled as custom commands and added
|
|
||||||
// to a custom target.
|
|
||||||
void CreateCustomTargetsAndCommands(std::set<std::string> const&);
|
|
||||||
|
|
||||||
// Handle old-style install rules stored in the targets.
|
// Handle old-style install rules stored in the targets.
|
||||||
void GenerateTargetInstallRules(
|
void GenerateTargetInstallRules(
|
||||||
std::ostream& os, const std::string& config,
|
std::ostream& os, const std::string& config,
|
||||||
|
@ -404,7 +404,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
|
|||||||
if (this->GetGlobalNinjaGenerator()->SeenCustomCommand(cc))
|
if (this->GetGlobalNinjaGenerator()->SeenCustomCommand(cc))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this->Makefile);
|
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this);
|
||||||
|
|
||||||
const std::vector<std::string> &outputs = ccg.GetOutputs();
|
const std::vector<std::string> &outputs = ccg.GetOutputs();
|
||||||
const std::vector<std::string> &byproducts = ccg.GetByproducts();
|
const std::vector<std::string> &byproducts = ccg.GetByproducts();
|
||||||
|
@ -1007,8 +1007,7 @@ cmLocalUnixMakefileGenerator3
|
|||||||
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
||||||
i != ccs.end(); ++i)
|
i != ccs.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*i, this->ConfigName,
|
cmCustomCommandGenerator ccg(*i, this->ConfigName, this);
|
||||||
this->Makefile);
|
|
||||||
this->AppendCustomDepend(depends, ccg);
|
this->AppendCustomDepend(depends, ccg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1043,8 +1042,7 @@ cmLocalUnixMakefileGenerator3
|
|||||||
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
|
||||||
i != ccs.end(); ++i)
|
i != ccs.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*i, this->ConfigName,
|
cmCustomCommandGenerator ccg(*i, this->ConfigName, this);
|
||||||
this->Makefile);
|
|
||||||
this->AppendCustomCommand(commands, ccg, target, true, relative);
|
this->AppendCustomCommand(commands, ccg, target, true, relative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
}
|
}
|
||||||
void Write(cmCustomCommand const& cc)
|
void Write(cmCustomCommand const& cc)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(cc, this->Config, this->LG->GetMakefile());
|
cmCustomCommandGenerator ccg(cc, this->Config, this->LG);
|
||||||
if(this->First)
|
if(this->First)
|
||||||
{
|
{
|
||||||
this->Code += this->Event + "_Cmds=";
|
this->Code += this->Event + "_Cmds=";
|
||||||
@ -82,14 +82,6 @@ private:
|
|||||||
std::string Event;
|
std::string Event;
|
||||||
};
|
};
|
||||||
|
|
||||||
void cmLocalVisualStudio6Generator::AddHelperCommands()
|
|
||||||
{
|
|
||||||
std::set<std::string> lang;
|
|
||||||
lang.insert("C");
|
|
||||||
lang.insert("CXX");
|
|
||||||
this->CreateCustomTargetsAndCommands(lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cmLocalVisualStudio6Generator::AddCMakeListsRules()
|
void cmLocalVisualStudio6Generator::AddCMakeListsRules()
|
||||||
{
|
{
|
||||||
cmTargets &tgts = this->Makefile->GetTargets();
|
cmTargets &tgts = this->Makefile->GetTargets();
|
||||||
@ -625,7 +617,7 @@ cmLocalVisualStudio6Generator
|
|||||||
for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
|
for(i = this->Configurations.begin(); i != this->Configurations.end(); ++i)
|
||||||
{
|
{
|
||||||
std::string config = this->GetConfigName(*i);
|
std::string config = this->GetConfigName(*i);
|
||||||
cmCustomCommandGenerator ccg(command, config, this->Makefile);
|
cmCustomCommandGenerator ccg(command, config, this);
|
||||||
std::string comment =
|
std::string comment =
|
||||||
this->ConstructComment(ccg, "Building Custom Rule $(InputPath)");
|
this->ConstructComment(ccg, "Building Custom Rule $(InputPath)");
|
||||||
if(comment == "<hack>")
|
if(comment == "<hack>")
|
||||||
|
@ -35,7 +35,6 @@ public:
|
|||||||
|
|
||||||
virtual ~cmLocalVisualStudio6Generator();
|
virtual ~cmLocalVisualStudio6Generator();
|
||||||
|
|
||||||
virtual void AddHelperCommands();
|
|
||||||
virtual void AddCMakeListsRules();
|
virtual void AddCMakeListsRules();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,15 +68,6 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator()
|
|||||||
|
|
||||||
void cmLocalVisualStudio7Generator::AddHelperCommands()
|
void cmLocalVisualStudio7Generator::AddHelperCommands()
|
||||||
{
|
{
|
||||||
std::set<std::string> lang;
|
|
||||||
lang.insert("C");
|
|
||||||
lang.insert("CXX");
|
|
||||||
lang.insert("RC");
|
|
||||||
lang.insert("IDL");
|
|
||||||
lang.insert("DEF");
|
|
||||||
lang.insert("Fortran");
|
|
||||||
this->CreateCustomTargetsAndCommands(lang);
|
|
||||||
|
|
||||||
// Now create GUIDs for targets
|
// Now create GUIDs for targets
|
||||||
cmTargets &tgts = this->Makefile->GetTargets();
|
cmTargets &tgts = this->Makefile->GetTargets();
|
||||||
|
|
||||||
@ -619,7 +610,7 @@ public:
|
|||||||
}
|
}
|
||||||
void Write(cmCustomCommand const& cc)
|
void Write(cmCustomCommand const& cc)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(cc, this->Config, this->LG->GetMakefile());
|
cmCustomCommandGenerator ccg(cc, this->Config, this->LG);
|
||||||
if(this->First)
|
if(this->First)
|
||||||
{
|
{
|
||||||
const char* comment = ccg.GetComment();
|
const char* comment = ccg.GetComment();
|
||||||
@ -1903,7 +1894,7 @@ WriteCustomRule(std::ostream& fout,
|
|||||||
for (std::vector<std::string>::const_iterator i = configs.begin();
|
for (std::vector<std::string>::const_iterator i = configs.begin();
|
||||||
i != configs.end(); ++i)
|
i != configs.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(command, *i, this->Makefile);
|
cmCustomCommandGenerator ccg(command, *i, this);
|
||||||
cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i];
|
cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i];
|
||||||
fout << "\t\t\t\t<FileConfiguration\n";
|
fout << "\t\t\t\t<FileConfiguration\n";
|
||||||
fout << "\t\t\t\t\tName=\"" << *i << "|"
|
fout << "\t\t\t\t\tName=\"" << *i << "|"
|
||||||
|
@ -416,6 +416,10 @@ public:
|
|||||||
{
|
{
|
||||||
this->GeneratorTargets = targets;
|
this->GeneratorTargets = targets;
|
||||||
}
|
}
|
||||||
|
void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt)
|
||||||
|
{
|
||||||
|
this->GeneratorTargets[t] = gt;
|
||||||
|
}
|
||||||
|
|
||||||
cmTarget* FindTarget(const std::string& name,
|
cmTarget* FindTarget(const std::string& name,
|
||||||
bool excludeAliases = false) const;
|
bool excludeAliases = false) const;
|
||||||
|
@ -167,7 +167,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
|||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*(*si)->GetCustomCommand(),
|
cmCustomCommandGenerator ccg(*(*si)->GetCustomCommand(),
|
||||||
this->ConfigName,
|
this->ConfigName,
|
||||||
this->Makefile);
|
this->LocalGenerator);
|
||||||
this->GenerateCustomRuleFile(ccg);
|
this->GenerateCustomRuleFile(ccg);
|
||||||
if (clean)
|
if (clean)
|
||||||
{
|
{
|
||||||
@ -546,7 +546,7 @@ cmMakefileTargetGenerator
|
|||||||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
|
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
|
||||||
{
|
{
|
||||||
targetFullPathReal =
|
targetFullPathReal =
|
||||||
this->Target->GetFullPath(this->ConfigName, false, true);
|
this->GeneratorTarget->GetFullPath(this->ConfigName, false, true);
|
||||||
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
|
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
|
||||||
targetFullPathPDB += "/";
|
targetFullPathPDB += "/";
|
||||||
targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
|
targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
|
||||||
@ -1182,7 +1182,8 @@ cmMakefileTargetGenerator
|
|||||||
{
|
{
|
||||||
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
|
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile);
|
cmCustomCommandGenerator ccg(*cc, this->ConfigName,
|
||||||
|
this->LocalGenerator);
|
||||||
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
const std::vector<std::string>& outputs = ccg.GetOutputs();
|
||||||
depends.insert(depends.end(), outputs.begin(), outputs.end());
|
depends.insert(depends.end(), outputs.begin(), outputs.end());
|
||||||
}
|
}
|
||||||
|
@ -398,15 +398,16 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
|
|||||||
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
||||||
{
|
{
|
||||||
cmTarget& target = *this->GetTarget();
|
cmTarget& target = *this->GetTarget();
|
||||||
|
cmGeneratorTarget& gt = *this->GetGeneratorTarget();
|
||||||
const std::string cfgName = this->GetConfigName();
|
const std::string cfgName = this->GetConfigName();
|
||||||
std::string targetOutput = ConvertToNinjaPath(
|
std::string targetOutput = ConvertToNinjaPath(
|
||||||
target.GetFullPath(cfgName));
|
gt.GetFullPath(cfgName));
|
||||||
std::string targetOutputReal = ConvertToNinjaPath(
|
std::string targetOutputReal = ConvertToNinjaPath(
|
||||||
target.GetFullPath(cfgName,
|
gt.GetFullPath(cfgName,
|
||||||
/*implib=*/false,
|
/*implib=*/false,
|
||||||
/*realpath=*/true));
|
/*realpath=*/true));
|
||||||
std::string targetOutputImplib = ConvertToNinjaPath(
|
std::string targetOutputImplib = ConvertToNinjaPath(
|
||||||
target.GetFullPath(cfgName,
|
gt.GetFullPath(cfgName,
|
||||||
/*implib=*/true));
|
/*implib=*/true));
|
||||||
|
|
||||||
if (target.IsAppBundleOnApple())
|
if (target.IsAppBundleOnApple())
|
||||||
@ -608,7 +609,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||||||
ci = cmdLists[i]->begin();
|
ci = cmdLists[i]->begin();
|
||||||
ci != cmdLists[i]->end(); ++ci)
|
ci != cmdLists[i]->end(); ++ci)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*ci, cfgName, mf);
|
cmCustomCommandGenerator ccg(*ci, cfgName, this->GetLocalGenerator());
|
||||||
localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
|
localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
|
||||||
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
||||||
std::transform(ccByproducts.begin(), ccByproducts.end(),
|
std::transform(ccByproducts.begin(), ccByproducts.end(),
|
||||||
|
@ -509,7 +509,7 @@ cmNinjaTargetGenerator
|
|||||||
{
|
{
|
||||||
cmCustomCommand const* cc = *cci;
|
cmCustomCommand const* cc = *cci;
|
||||||
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
|
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
|
||||||
this->GetMakefile());
|
this->GetLocalGenerator());
|
||||||
const std::vector<std::string>& ccoutputs = ccg.GetOutputs();
|
const std::vector<std::string>& ccoutputs = ccg.GetOutputs();
|
||||||
const std::vector<std::string>& ccbyproducts= ccg.GetByproducts();
|
const std::vector<std::string>& ccbyproducts= ccg.GetByproducts();
|
||||||
std::transform(ccoutputs.begin(), ccoutputs.end(),
|
std::transform(ccoutputs.begin(), ccoutputs.end(),
|
||||||
|
@ -44,7 +44,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
|
|||||||
for (std::vector<cmCustomCommand>::const_iterator
|
for (std::vector<cmCustomCommand>::const_iterator
|
||||||
ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) {
|
ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) {
|
||||||
cmCustomCommandGenerator ccg(*ci, this->GetConfigName(),
|
cmCustomCommandGenerator ccg(*ci, this->GetConfigName(),
|
||||||
this->GetMakefile());
|
this->GetLocalGenerator());
|
||||||
this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps);
|
this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps);
|
||||||
this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands);
|
this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands);
|
||||||
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
||||||
@ -65,7 +65,7 @@ void cmNinjaUtilityTargetGenerator::Generate()
|
|||||||
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
|
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
|
cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
|
||||||
this->GetMakefile());
|
this->GetLocalGenerator());
|
||||||
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
|
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
|
||||||
|
|
||||||
// Depend on all custom command outputs.
|
// Depend on all custom command outputs.
|
||||||
|
@ -287,7 +287,8 @@ std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf,
|
|||||||
return entriesList;
|
return entriesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
|
bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
|
||||||
|
cmTarget* target)
|
||||||
{
|
{
|
||||||
cmMakefile* makefile = target->GetMakefile();
|
cmMakefile* makefile = target->GetMakefile();
|
||||||
// don't do anything if there is no Qt4 or Qt5Core (which contains moc):
|
// don't do anything if there is no Qt4 or Qt5Core (which contains moc):
|
||||||
@ -474,6 +475,10 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
|
|||||||
/*byproducts=*/rcc_output, depends,
|
/*byproducts=*/rcc_output, depends,
|
||||||
commandLines, false, autogenComment.c_str());
|
commandLines, false, autogenComment.c_str());
|
||||||
|
|
||||||
|
cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
|
||||||
|
lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
|
||||||
|
makefile->AddGeneratorTarget(autogenTarget, gt);
|
||||||
|
|
||||||
// Set target folder
|
// Set target folder
|
||||||
const char* autogenFolder = makefile->GetState()
|
const char* autogenFolder = makefile->GetState()
|
||||||
->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
|
->GetGlobalProperty("AUTOMOC_TARGETS_FOLDER");
|
||||||
@ -804,7 +809,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
|
|||||||
autogenTargetName.c_str());
|
autogenTargetName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
makefile->AddDefinition("_qt_moc_executable", qt5Moc->GetLocation(""));
|
makefile->AddDefinition("_qt_moc_executable",
|
||||||
|
qt5Moc->ImportedGetLocation(""));
|
||||||
}
|
}
|
||||||
else if (strcmp(qtVersion, "4") == 0)
|
else if (strcmp(qtVersion, "4") == 0)
|
||||||
{
|
{
|
||||||
@ -815,7 +821,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
|
|||||||
autogenTargetName.c_str());
|
autogenTargetName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
makefile->AddDefinition("_qt_moc_executable", qt4Moc->GetLocation(""));
|
makefile->AddDefinition("_qt_moc_executable",
|
||||||
|
qt4Moc->ImportedGetLocation(""));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -962,7 +969,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
makefile->AddDefinition("_qt_uic_executable", qt5Uic->GetLocation(""));
|
makefile->AddDefinition("_qt_uic_executable",
|
||||||
|
qt5Uic->ImportedGetLocation(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(qtVersion, "4") == 0)
|
else if (strcmp(qtVersion, "4") == 0)
|
||||||
@ -974,7 +982,8 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
|
|||||||
targetName.c_str());
|
targetName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
makefile->AddDefinition("_qt_uic_executable", qt4Uic->GetLocation(""));
|
makefile->AddDefinition("_qt_uic_executable",
|
||||||
|
qt4Uic->ImportedGetLocation(""));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1166,7 +1175,7 @@ std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
|
|||||||
targetName.c_str());
|
targetName.c_str());
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
return qt5Rcc->GetLocation("");
|
return qt5Rcc->ImportedGetLocation("");
|
||||||
}
|
}
|
||||||
else if (strcmp(qtVersion, "4") == 0)
|
else if (strcmp(qtVersion, "4") == 0)
|
||||||
{
|
{
|
||||||
@ -1177,7 +1186,7 @@ std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
|
|||||||
targetName.c_str());
|
targetName.c_str());
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
return qt4Rcc->GetLocation("");
|
return qt4Rcc->ImportedGetLocation("");
|
||||||
}
|
}
|
||||||
|
|
||||||
cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
|
cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and "
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
class cmMakefile;
|
class cmMakefile;
|
||||||
|
class cmLocalGenerator;
|
||||||
|
|
||||||
class cmQtAutoGenerators
|
class cmQtAutoGenerators
|
||||||
{
|
{
|
||||||
@ -25,7 +26,7 @@ public:
|
|||||||
cmQtAutoGenerators();
|
cmQtAutoGenerators();
|
||||||
bool Run(const std::string& targetDirectory, const std::string& config);
|
bool Run(const std::string& targetDirectory, const std::string& config);
|
||||||
|
|
||||||
bool InitializeAutogenTarget(cmTarget* target);
|
bool InitializeAutogenTarget(cmLocalGenerator* lg, cmTarget* target);
|
||||||
void SetupAutoGenerateTarget(cmTarget const* target);
|
void SetupAutoGenerateTarget(cmTarget const* target);
|
||||||
void SetupSourceFiles(cmTarget const* target);
|
void SetupSourceFiles(cmTarget const* target);
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files,
|
|||||||
{
|
{
|
||||||
assert(this->GetType() != INTERFACE_LIBRARY);
|
assert(this->GetType() != INTERFACE_LIBRARY);
|
||||||
|
|
||||||
if (this->Makefile->GetGeneratorTargets().empty())
|
if (!this->Makefile->IsConfigured())
|
||||||
{
|
{
|
||||||
// At configure-time, this method can be called as part of getting the
|
// At configure-time, this method can be called as part of getting the
|
||||||
// LOCATION property or to export() a file to be include()d. However
|
// LOCATION property or to export() a file to be include()d. However
|
||||||
@ -2750,50 +2750,11 @@ std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
const char* cmTarget::GetLocation(const std::string& config) const
|
const char* cmTarget::ImportedGetLocation(const std::string& config) const
|
||||||
{
|
{
|
||||||
static std::string location;
|
static std::string location;
|
||||||
if (this->IsImported())
|
assert(this->IsImported());
|
||||||
{
|
location = this->ImportedGetFullPath(config, false);
|
||||||
location = this->ImportedGetFullPath(config, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
location = this->GetFullPath(config, false);
|
|
||||||
}
|
|
||||||
return location.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
const char* cmTarget::GetLocationForBuild() const
|
|
||||||
{
|
|
||||||
static std::string location;
|
|
||||||
if(this->IsImported())
|
|
||||||
{
|
|
||||||
location = this->ImportedGetFullPath("", false);
|
|
||||||
return location.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now handle the deprecated build-time configuration location.
|
|
||||||
location = this->GetDirectory();
|
|
||||||
const char* cfgid = this->Makefile->GetDefinition("CMAKE_CFG_INTDIR");
|
|
||||||
if(cfgid && strcmp(cfgid, ".") != 0)
|
|
||||||
{
|
|
||||||
location += "/";
|
|
||||||
location += cfgid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this->IsAppBundleOnApple())
|
|
||||||
{
|
|
||||||
std::string macdir = this->BuildMacContentDirectory("", "", false);
|
|
||||||
if(!macdir.empty())
|
|
||||||
{
|
|
||||||
location += "/";
|
|
||||||
location += macdir;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
location += "/";
|
|
||||||
location += this->GetFullName("", false);
|
|
||||||
return location.c_str();
|
return location.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2928,11 +2889,24 @@ const char *cmTarget::GetProperty(const std::string& prop,
|
|||||||
// For an imported target this is the location of an arbitrary
|
// For an imported target this is the location of an arbitrary
|
||||||
// available configuration.
|
// available configuration.
|
||||||
//
|
//
|
||||||
// For a non-imported target this is deprecated because it
|
if(this->IsImported())
|
||||||
// cannot take into account the per-configuration name of the
|
{
|
||||||
// target because the configuration type may not be known at
|
this->Properties.SetProperty(
|
||||||
// CMake time.
|
propLOCATION, this->ImportedGetFullPath("", false).c_str());
|
||||||
this->Properties.SetProperty(propLOCATION, this->GetLocationForBuild());
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// For a non-imported target this is deprecated because it
|
||||||
|
// cannot take into account the per-configuration name of the
|
||||||
|
// target because the configuration type may not be known at
|
||||||
|
// CMake time.
|
||||||
|
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
|
||||||
|
gg->CreateGenerationObjects();
|
||||||
|
cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
|
||||||
|
this->Properties.SetProperty(propLOCATION,
|
||||||
|
gt->GetLocationForBuild());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support "LOCATION_<CONFIG>".
|
// Support "LOCATION_<CONFIG>".
|
||||||
@ -2943,7 +2917,20 @@ const char *cmTarget::GetProperty(const std::string& prop,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const char* configName = prop.c_str() + 9;
|
const char* configName = prop.c_str() + 9;
|
||||||
this->Properties.SetProperty(prop, this->GetLocation(configName));
|
|
||||||
|
if (this->IsImported())
|
||||||
|
{
|
||||||
|
this->Properties.SetProperty(
|
||||||
|
prop, this->ImportedGetFullPath(configName, false).c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
|
||||||
|
gg->CreateGenerationObjects();
|
||||||
|
cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
|
||||||
|
this->Properties.SetProperty(
|
||||||
|
prop, gt->GetFullPath(configName, false).c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Support "<CONFIG>_LOCATION".
|
// Support "<CONFIG>_LOCATION".
|
||||||
else if(cmHasLiteralSuffix(prop, "_LOCATION"))
|
else if(cmHasLiteralSuffix(prop, "_LOCATION"))
|
||||||
@ -2955,7 +2942,19 @@ const char *cmTarget::GetProperty(const std::string& prop,
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
this->Properties.SetProperty(prop, this->GetLocation(configName));
|
if (this->IsImported())
|
||||||
|
{
|
||||||
|
this->Properties.SetProperty(
|
||||||
|
prop, this->ImportedGetFullPath(configName, false).c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
|
||||||
|
gg->CreateGenerationObjects();
|
||||||
|
cmGeneratorTarget* gt = gg->GetGeneratorTarget(this);
|
||||||
|
this->Properties.SetProperty(
|
||||||
|
prop, gt->GetFullPath(configName, false).c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3770,44 +3769,6 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
std::string cmTarget::NormalGetRealName(const std::string& config) const
|
|
||||||
{
|
|
||||||
// This should not be called for imported targets.
|
|
||||||
// TODO: Split cmTarget into a class hierarchy to get compile-time
|
|
||||||
// enforcement of the limited imported target API.
|
|
||||||
if(this->IsImported())
|
|
||||||
{
|
|
||||||
std::string msg = "NormalGetRealName called on imported target: ";
|
|
||||||
msg += this->GetName();
|
|
||||||
this->GetMakefile()->
|
|
||||||
IssueMessage(cmake::INTERNAL_ERROR,
|
|
||||||
msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this->GetType() == cmTarget::EXECUTABLE)
|
|
||||||
{
|
|
||||||
// Compute the real name that will be built.
|
|
||||||
std::string name;
|
|
||||||
std::string realName;
|
|
||||||
std::string impName;
|
|
||||||
std::string pdbName;
|
|
||||||
this->GetExecutableNames(name, realName, impName, pdbName, config);
|
|
||||||
return realName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Compute the real name that will be built.
|
|
||||||
std::string name;
|
|
||||||
std::string soName;
|
|
||||||
std::string realName;
|
|
||||||
std::string impName;
|
|
||||||
std::string pdbName;
|
|
||||||
this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
|
|
||||||
return realName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmTarget::GetFullName(const std::string& config,
|
std::string cmTarget::GetFullName(const std::string& config,
|
||||||
bool implib) const
|
bool implib) const
|
||||||
@ -3839,48 +3800,6 @@ void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
|
|||||||
this->GetFullNameInternal(config, implib, prefix, base, suffix);
|
this->GetFullNameInternal(config, implib, prefix, base, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
std::string cmTarget::GetFullPath(const std::string& config, bool implib,
|
|
||||||
bool realname) const
|
|
||||||
{
|
|
||||||
if(this->IsImported())
|
|
||||||
{
|
|
||||||
return this->ImportedGetFullPath(config, implib);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return this->NormalGetFullPath(config, implib, realname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
std::string cmTarget::NormalGetFullPath(const std::string& config,
|
|
||||||
bool implib, bool realname) const
|
|
||||||
{
|
|
||||||
std::string fpath = this->GetDirectory(config, implib);
|
|
||||||
fpath += "/";
|
|
||||||
if(this->IsAppBundleOnApple())
|
|
||||||
{
|
|
||||||
fpath = this->BuildMacContentDirectory(fpath, config, false);
|
|
||||||
fpath += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the full name of the target.
|
|
||||||
if(implib)
|
|
||||||
{
|
|
||||||
fpath += this->GetFullName(config, true);
|
|
||||||
}
|
|
||||||
else if(realname)
|
|
||||||
{
|
|
||||||
fpath += this->NormalGetRealName(config);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fpath += this->GetFullName(config, false);
|
|
||||||
}
|
|
||||||
return fpath;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string
|
std::string
|
||||||
cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
|
cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
|
||||||
@ -5260,7 +5179,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages,
|
|||||||
|
|
||||||
std::vector<cmTarget*> objectLibraries;
|
std::vector<cmTarget*> objectLibraries;
|
||||||
std::vector<cmSourceFile const*> externalObjects;
|
std::vector<cmSourceFile const*> externalObjects;
|
||||||
if (this->Makefile->GetGeneratorTargets().empty())
|
if (!this->Makefile->IsConfigured())
|
||||||
{
|
{
|
||||||
this->GetObjectLibrariesCMP0026(objectLibraries);
|
this->GetObjectLibrariesCMP0026(objectLibraries);
|
||||||
}
|
}
|
||||||
|
@ -374,14 +374,7 @@ public:
|
|||||||
compiler pdb output directory is given. */
|
compiler pdb output directory is given. */
|
||||||
std::string GetCompilePDBDirectory(const std::string& config = "") const;
|
std::string GetCompilePDBDirectory(const std::string& config = "") const;
|
||||||
|
|
||||||
/** Get the location of the target in the build tree for the given
|
const char* ImportedGetLocation(const std::string& config) const;
|
||||||
configuration. */
|
|
||||||
const char* GetLocation(const std::string& config) const;
|
|
||||||
|
|
||||||
/** Get the location of the target in the build tree with a placeholder
|
|
||||||
referencing the configuration in the native build system. This
|
|
||||||
location is suitable for use as the LOCATION target property. */
|
|
||||||
const char* GetLocationForBuild() const;
|
|
||||||
|
|
||||||
/** Get the target major and minor version numbers interpreted from
|
/** Get the target major and minor version numbers interpreted from
|
||||||
the VERSION property. Version 0 is returned if the property is
|
the VERSION property. Version 0 is returned if the property is
|
||||||
@ -431,11 +424,6 @@ public:
|
|||||||
no soname at all. */
|
no soname at all. */
|
||||||
bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
|
bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
|
||||||
|
|
||||||
/** Get the full path to the target according to the settings in its
|
|
||||||
makefile and the configuration type. */
|
|
||||||
std::string GetFullPath(const std::string& config="", bool implib = false,
|
|
||||||
bool realname = false) const;
|
|
||||||
|
|
||||||
/** Get the names of the library needed to generate a build rule
|
/** Get the names of the library needed to generate a build rule
|
||||||
that takes into account shared library version numbers. This
|
that takes into account shared library version numbers. This
|
||||||
should be called only on a library target. */
|
should be called only on a library target. */
|
||||||
@ -718,14 +706,6 @@ private:
|
|||||||
|
|
||||||
std::string ImportedGetFullPath(const std::string& config,
|
std::string ImportedGetFullPath(const std::string& config,
|
||||||
bool implib) const;
|
bool implib) const;
|
||||||
std::string NormalGetFullPath(const std::string& config, bool implib,
|
|
||||||
bool realname) const;
|
|
||||||
|
|
||||||
/** Get the real name of the target. Allowed only for non-imported
|
|
||||||
targets. When a library or executable file is versioned this is
|
|
||||||
the full versioned name. If the target is not versioned this is
|
|
||||||
the same as GetFullName. */
|
|
||||||
std::string NormalGetRealName(const std::string& config) const;
|
|
||||||
|
|
||||||
/** Append to @a base the mac content directory and return it. */
|
/** Append to @a base the mac content directory and return it. */
|
||||||
std::string BuildMacContentDirectory(const std::string& base,
|
std::string BuildMacContentDirectory(const std::string& base,
|
||||||
|
@ -82,7 +82,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
|
|||||||
// be translated.
|
// be translated.
|
||||||
std::string exe = command[0];
|
std::string exe = command[0];
|
||||||
cmMakefile* mf = this->Test->GetMakefile();
|
cmMakefile* mf = this->Test->GetMakefile();
|
||||||
cmTarget* target = mf->FindTargetToUse(exe);
|
cmGeneratorTarget* target = mf->FindGeneratorTargetToUse(exe);
|
||||||
if(target && target->GetType() == cmTarget::EXECUTABLE)
|
if(target && target->GetType() == cmTarget::EXECUTABLE)
|
||||||
{
|
{
|
||||||
// Use the target file on disk.
|
// Use the target file on disk.
|
||||||
|
@ -890,7 +890,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile const* source,
|
|||||||
i = this->Configurations.begin();
|
i = this->Configurations.begin();
|
||||||
i != this->Configurations.end(); ++i)
|
i != this->Configurations.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(command, *i, this->Makefile);
|
cmCustomCommandGenerator ccg(command, *i, this->LocalGenerator);
|
||||||
std::string comment = lg->ConstructComment(ccg);
|
std::string comment = lg->ConstructComment(ccg);
|
||||||
comment = cmVS10EscapeComment(comment);
|
comment = cmVS10EscapeComment(comment);
|
||||||
std::string script =
|
std::string script =
|
||||||
@ -2794,7 +2794,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
|
|||||||
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
|
||||||
i != commands.end(); ++i)
|
i != commands.end(); ++i)
|
||||||
{
|
{
|
||||||
cmCustomCommandGenerator ccg(*i, configName, this->Makefile);
|
cmCustomCommandGenerator ccg(*i, configName, this->LocalGenerator);
|
||||||
comment += pre;
|
comment += pre;
|
||||||
comment += lg->ConstructComment(ccg);
|
comment += lg->ConstructComment(ccg);
|
||||||
script += pre;
|
script += pre;
|
||||||
|
@ -484,7 +484,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
|
|||||||
std::string linkPath;
|
std::string linkPath;
|
||||||
std::string flags;
|
std::string flags;
|
||||||
std::string linkFlags;
|
std::string linkFlags;
|
||||||
gg->CreateGeneratorTargets(lg.get());
|
gg->CreateGeneratorTargets(cmGlobalGenerator::AllTargets, lg.get());
|
||||||
cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
|
cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
|
||||||
lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
|
lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
|
||||||
gtgt, false);
|
gtgt, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user