| 50 | } |
| 51 | |
| 52 | bool cmExportCMakeConfigGenerator::GenerateImportFile(std::ostream& os) |
| 53 | { |
| 54 | std::stringstream mainFileWithHeadersAndFootersBuffer; |
| 55 | |
| 56 | // Start with the import file header. |
| 57 | this->GenerateImportHeaderCode(mainFileWithHeadersAndFootersBuffer); |
| 58 | |
| 59 | // Create all the imported targets. |
| 60 | std::stringstream mainFileBuffer; |
| 61 | bool result = this->GenerateMainFile(mainFileBuffer); |
| 62 | |
| 63 | // Export find_dependency() calls. Must be done after GenerateMainFile(), |
| 64 | // because that's when target dependencies are gathered, which we need for |
| 65 | // the find_dependency() calls. |
| 66 | if (!this->AppendMode && this->GetExportSet() && |
| 67 | this->ExportPackageDependencies) { |
| 68 | this->SetRequiredCMakeVersion(3, 9, 0); |
| 69 | this->GenerateFindDependencyCalls(mainFileWithHeadersAndFootersBuffer); |
| 70 | } |
| 71 | |
| 72 | // Write cached import code. |
| 73 | mainFileWithHeadersAndFootersBuffer << mainFileBuffer.rdbuf(); |
| 74 | |
| 75 | // End with the import file footer. |
| 76 | this->GenerateImportFooterCode(mainFileWithHeadersAndFootersBuffer); |
| 77 | this->GeneratePolicyFooterCode(mainFileWithHeadersAndFootersBuffer); |
| 78 | |
| 79 | // This has to be done last, after the minimum CMake version has been |
| 80 | // determined. |
| 81 | this->GeneratePolicyHeaderCode(os); |
| 82 | os << mainFileWithHeadersAndFootersBuffer.rdbuf(); |
| 83 | |
| 84 | return result; |
| 85 | } |
| 86 | |
| 87 | void cmExportCMakeConfigGenerator::GenerateInterfaceProperties( |
| 88 | cmGeneratorTarget const* target, std::ostream& os, |
nothing calls this directly
no test coverage detected