diff options
author | Brad King <brad.king@kitware.com> | 2008-02-06 19:20:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-06 19:20:36 (GMT) |
commit | 9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9 (patch) | |
tree | 91922579fd8e7264d435c8492e775fe777db611f /Source/cmExportBuildFileGenerator.cxx | |
parent | afad12431371d9a725b9a85db39f8c4da37fabaf (diff) | |
download | CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.zip CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.gz CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.bz2 |
ENH: Improve exporting/importing of targets
- Use real name instead of link for location of versioned targets
- Error when a target is exported multiple times
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; } |