mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
export(): Process the export() command at generate time.
Make the API for adding targets string based so that it can easily use cmGeneratorTarget. Teach the cmIncludeCommand to generate the exported file at configure-time instead if it is to be include()d. The RunCMake.ExportWithoutLanguage test now needs a dummy header.h file as expected error from export() is now reported after the missing file error.
This commit is contained in:
@@ -21,20 +21,19 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator()
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
{
|
||||
std::vector<cmTarget*> allTargets;
|
||||
{
|
||||
std::string expectedTargets;
|
||||
std::string sep;
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = this->Exports->begin();
|
||||
tei != this->Exports->end(); ++tei)
|
||||
for(std::vector<std::string>::const_iterator
|
||||
tei = this->Targets.begin();
|
||||
tei != this->Targets.end(); ++tei)
|
||||
{
|
||||
expectedTargets += sep + this->Namespace + (*tei)->GetExportName();
|
||||
cmTarget *te = this->Makefile->FindTargetToUse(tei->c_str());
|
||||
expectedTargets += sep + this->Namespace + te->GetExportName();
|
||||
sep = " ";
|
||||
cmTarget* te = *tei;
|
||||
if(this->ExportedTargets.insert(te).second)
|
||||
{
|
||||
allTargets.push_back(te);
|
||||
this->Exports.push_back(te);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -57,8 +56,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
||||
|
||||
// Create all the imported targets.
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = allTargets.begin();
|
||||
tei != allTargets.end(); ++tei)
|
||||
tei = this->Exports.begin();
|
||||
tei != this->Exports.end(); ++tei)
|
||||
{
|
||||
cmTarget* te = *tei;
|
||||
this->GenerateImportTargetCode(os, te);
|
||||
@@ -113,8 +112,8 @@ cmExportBuildFileGenerator
|
||||
std::vector<std::string> &missingTargets)
|
||||
{
|
||||
for(std::vector<cmTarget*>::const_iterator
|
||||
tei = this->Exports->begin();
|
||||
tei != this->Exports->end(); ++tei)
|
||||
tei = this->Exports.begin();
|
||||
tei != this->Exports.end(); ++tei)
|
||||
{
|
||||
// Collect import properties for this target.
|
||||
cmTarget* target = *tei;
|
||||
|
||||
Reference in New Issue
Block a user