MCPcopy Create free account
hub / github.com/Kitware/CMake / GenerateInstallerFile

Method GenerateInstallerFile

Source/CPack/IFW/cmCPackIFWInstaller.cxx:423–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421};
422
423void cmCPackIFWInstaller::GenerateInstallerFile()
424{
425 // Lazy directory initialization
426 if (this->Directory.empty() && this->Generator) {
427 this->Directory = this->Generator->toplevel;
428 }
429
430 // Output stream
431 cmGeneratedFileStream fout(this->Directory + "/config/config.xml");
432 cmXMLWriter xout(fout);
433
434 xout.StartDocument();
435
436 this->WriteGeneratedByToStrim(xout);
437
438 xout.StartElement("Installer");
439
440 xout.Element("Name", this->Name);
441 xout.Element("Version", this->Version);
442 xout.Element("Title", this->Title);
443
444 if (!this->Publisher.empty()) {
445 xout.Element("Publisher", this->Publisher);
446 }
447
448 if (!this->ProductUrl.empty()) {
449 xout.Element("ProductUrl", this->ProductUrl);
450 }
451
452 // Logo
453 if (!this->Logo.empty()) {
454 std::string srcName = cmSystemTools::GetFilenameName(this->Logo);
455 std::string suffix = cmSystemTools::GetFilenameLastExtension(srcName);
456 std::string name = "cm_logo" + suffix;
457 std::string path = this->Directory + "/config/" + name;
458 cmsys::SystemTools::CopyFileIfDifferent(this->Logo, path);
459 xout.Element("Logo", name);
460 }
461
462 // Banner
463 if (!this->Banner.empty()) {
464 std::string name = cmSystemTools::GetFilenameName(this->Banner);
465 std::string path = this->Directory + "/config/" + name;
466 cmsys::SystemTools::CopyFileIfDifferent(this->Banner, path);
467 xout.Element("Banner", name);
468 }
469
470 // Watermark
471 if (!this->Watermark.empty()) {
472 std::string name = cmSystemTools::GetFilenameName(this->Watermark);
473 std::string path = this->Directory + "/config/" + name;
474 cmsys::SystemTools::CopyFileIfDifferent(this->Watermark, path);
475 xout.Element("Watermark", name);
476 }
477
478 // Background
479 if (!this->Background.empty()) {
480 std::string name = cmSystemTools::GetFilenameName(this->Background);

Callers 1

PackageFilesMethod · 0.80

Calls 15

moveFunction · 0.85
StartDocumentMethod · 0.80
IsVersionLessMethod · 0.80
WriteRepositoryConfigMethod · 0.80
ParseResourceMethod · 0.80
push_backMethod · 0.80
EndDocumentMethod · 0.80
emptyMethod · 0.45
StartElementMethod · 0.45
ElementMethod · 0.45
CommentMethod · 0.45

Tested by

no test coverage detected