diff options
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index bf18deb..fed0dbc 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -18,7 +18,7 @@ //---------------------------------------------------------------------------- cmExportBuildFileGenerator::cmExportBuildFileGenerator() - : Backtrace(NULL) + : Backtrace() { this->Makefile = 0; this->ExportSet = 0; @@ -27,6 +27,7 @@ cmExportBuildFileGenerator::cmExportBuildFileGenerator() //---------------------------------------------------------------------------- bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) { + std::vector<cmGeneratorTarget*> allTargets; { std::string expectedTargets; std::string sep; @@ -36,10 +37,11 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) tei = targets.begin(); tei != targets.end(); ++tei) { - cmTarget *te = this->Makefile->FindTargetToUse(*tei); - expectedTargets += sep + this->Namespace + te->GetExportName(); + cmGeneratorTarget *te = this->Makefile + ->FindGeneratorTargetToUse(*tei); + expectedTargets += sep + this->Namespace + te->Target->GetExportName(); sep = " "; - if(this->ExportedTargets.insert(te).second) + if(this->ExportedTargets.insert(te->Target).second) { this->Exports.push_back(te); } @@ -63,11 +65,12 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) std::vector<std::string> missingTargets; // Create all the imported targets. - for(std::vector<cmTarget*>::const_iterator + for(std::vector<cmGeneratorTarget*>::const_iterator tei = this->Exports.begin(); tei != this->Exports.end(); ++tei) { - cmTarget* te = *tei; + cmGeneratorTarget* gte = *tei; + cmTarget* te = gte->Target; this->GenerateImportTargetCode(os, te); te->AppendBuildInterfaceIncludes(); @@ -103,7 +106,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) cmGeneratorExpression::BuildInterface, properties, missingTargets); } - this->PopulateCompatibleInterfaceProperties(te, properties); + this->PopulateCompatibleInterfaceProperties(gte, properties); this->GenerateInterfaceProperties(te, os, properties); } @@ -129,12 +132,12 @@ cmExportBuildFileGenerator std::string const& suffix, std::vector<std::string> &missingTargets) { - for(std::vector<cmTarget*>::const_iterator + for(std::vector<cmGeneratorTarget*>::const_iterator tei = this->Exports.begin(); tei != this->Exports.end(); ++tei) { // Collect import properties for this target. - cmTarget* target = *tei; + cmGeneratorTarget* target = *tei; ImportPropertyMap properties; if (target->GetType() != cmTarget::INTERFACE_LIBRARY) @@ -147,10 +150,12 @@ cmExportBuildFileGenerator if (target->GetType() != cmTarget::INTERFACE_LIBRARY) { this->SetImportDetailProperties(config, suffix, - target, properties, missingTargets); + target, + properties, missingTargets); this->SetImportLinkInterface(config, suffix, - cmGeneratorExpression::BuildInterface, - target, properties, missingTargets); + cmGeneratorExpression::BuildInterface, + target, + properties, missingTargets); } // TOOD: PUBLIC_HEADER_LOCATION @@ -160,7 +165,8 @@ cmExportBuildFileGenerator // properties); // Generate code in the export file. - this->GenerateImportPropertyCode(os, config, target, properties); + this->GenerateImportPropertyCode(os, config, target->Target, + properties); } } } @@ -176,17 +182,18 @@ void cmExportBuildFileGenerator ::SetImportLocationProperty(const std::string& config, std::string const& suffix, - cmTarget* target, ImportPropertyMap& properties) + cmGeneratorTarget* target, + ImportPropertyMap& properties) { // Get the makefile in which to lookup target information. - cmMakefile* mf = target->GetMakefile(); + cmMakefile* mf = target->Makefile; // Add the main target file. { std::string prop = "IMPORTED_LOCATION"; prop += suffix; std::string value; - if(target->IsAppBundleOnApple()) + if(target->Target->IsAppBundleOnApple()) { value = target->GetFullPath(config, false); } @@ -204,13 +211,13 @@ cmExportBuildFileGenerator // Add the import library for windows DLLs. if(dll_platform && (target->GetType() == cmTarget::SHARED_LIBRARY || - target->IsExecutableWithExports()) && + target->Target->IsExecutableWithExports()) && mf->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")) { std::string prop = "IMPORTED_IMPLIB"; prop += suffix; std::string value = target->GetFullPath(config, true); - target->GetImplibGNUtoMS(value, value, + target->Target->GetImplibGNUtoMS(value, value, "${CMAKE_IMPORT_LIBRARY_SUFFIX}"); properties[prop] = value; } @@ -326,12 +333,12 @@ cmExportBuildFileGenerator } std::string -cmExportBuildFileGenerator::InstallNameDir(cmTarget* target, +cmExportBuildFileGenerator::InstallNameDir(cmGeneratorTarget* target, const std::string& config) { std::string install_name_dir; - cmMakefile* mf = target->GetMakefile(); + cmMakefile* mf = target->Target->GetMakefile(); if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { install_name_dir = |