Skip to content

Commit

Permalink
Merge topic 'cpack-ifw-stylesheet'
Browse files Browse the repository at this point in the history
c474fb2 CPack/IFW: Add StyleSheet field

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3270
  • Loading branch information
bradking authored and kwrobot committed May 3, 2019
2 parents 9713154 + c474fb2 commit 6f242ac
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Help/cpack_gen/ifw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions Help/release/dev/cpackifw-package-style-sheet.rst
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 17 additions & 0 deletions Source/CPack/IFW/cmCPackIFWInstaller.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions Source/CPack/IFW/cmCPackIFWInstaller.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class cmCPackIFWInstaller : public cmCPackIFWCommon
/// Wizard style name
std::string WizardStyle;

/// Filename for a style sheet
std::string StyleSheet;

/// Wizard width
std::string WizardDefaultWidth;

Expand Down

0 comments on commit 6f242ac

Please sign in to comment.