CPack/IFW: Add StyleSheet field

This commit is contained in:
Zaytsev Yuriy
2019-04-29 22:08:08 +03:00
committed by Brad King
parent 1c7863a765
commit c474fb2777
4 changed files with 30 additions and 0 deletions

View File

@@ -135,6 +135,10 @@ Package
Wizard style to be used ("Modern", "Mac", "Aero" or "Classic").
.. variable:: CPACK_IFW_PACKAGE_STYLE_SHEET
Filename for a stylesheet.
.. variable:: CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
Default width of the wizard in pixels. Setting a banner image will override this.

View File

@@ -0,0 +1,6 @@
cpackifw-package-style-sheet
----------------------------
* The :cpack_gen:`CPack IFW Generator` gained a new
:variable:`CPACK_IFW_PACKAGE_STYLE_SHEET` variable to customize the
installer stylesheet.

View File

@@ -152,6 +152,15 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
}
}
// StyleSheet
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) {
if (cmSystemTools::FileExists(option)) {
this->StyleSheet = option;
} else {
this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option);
}
}
// WizardDefaultWidth
if (const char* option =
this->GetOption("CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH")) {
@@ -381,6 +390,14 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
xout.Element("WizardStyle", this->WizardStyle);
}
// Stylesheet
if (!this->StyleSheet.empty()) {
std::string name = cmSystemTools::GetFilenameName(this->StyleSheet);
std::string path = this->Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(this->StyleSheet, path);
xout.Element("StyleSheet", name);
}
// WizardDefaultWidth
if (!this->WizardDefaultWidth.empty()) {
xout.Element("WizardDefaultWidth", this->WizardDefaultWidth);

View File

@@ -72,6 +72,9 @@ public:
/// Wizard style name
std::string WizardStyle;
/// Filename for a style sheet
std::string StyleSheet;
/// Wizard width
std::string WizardDefaultWidth;