diff options
Diffstat (limited to 'Source/cmExportBuildFileGenerator.cxx')
-rw-r--r-- | Source/cmExportBuildFileGenerator.cxx | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 6506254..429bb53 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -33,8 +33,20 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) tei != this->Exports->end(); ++tei) { cmTarget* te = *tei; - this->ExportedTargets.insert(te); - this->GenerateImportTargetCode(os, te); + if(this->ExportedTargets.insert(te).second) + { + this->GenerateImportTargetCode(os, te); + } + else + { + if(this->ExportCommand && this->ExportCommand->ErrorMessage.empty()) + { + cmOStringStream e; + e << "given target \"" << te->GetName() << "\" more than once."; + this->ExportCommand->ErrorMessage = e.str(); + } + return false; + } } // Generate import file content for each configuration. @@ -93,12 +105,21 @@ cmExportBuildFileGenerator { std::string prop = "IMPORTED_LOCATION"; prop += suffix; - std::string value = target->GetFullPath(config, false); - if(target->IsAppBundleOnApple()) + std::string value; + if(target->IsFrameworkOnApple()) { + value = target->GetFullPath(config, false); + } + else if(target->IsAppBundleOnApple()) + { + value = target->GetFullPath(config, false); value += ".app/Contents/MacOS/"; value += target->GetFullName(config, false); } + else + { + value = target->GetFullPath(config, false, true); + } properties[prop] = value; } |