diff options
author | Jean-Philippe Lebel <Jean-Philippe Lebel jp@lebel.pro> | 2016-11-22 22:56:18 (GMT) |
---|---|---|
committer | Jean-Philippe Lebel <Jean-Philippe Lebel jp@lebel.pro> | 2017-12-15 18:24:58 (GMT) |
commit | 739ae1d090094eea6fc545d4d1567b7db9f9683c (patch) | |
tree | 0376d8f0efcf25db6b835c60895668c47515ac6a | |
parent | bd10c3cf82f6e9d58b121498eaa2b9d8cc19dd2f (diff) | |
download | CMake-739ae1d090094eea6fc545d4d1567b7db9f9683c.zip CMake-739ae1d090094eea6fc545d4d1567b7db9f9683c.tar.gz CMake-739ae1d090094eea6fc545d4d1567b7db9f9683c.tar.bz2 |
CPack/IFW: Add option to control deletion of the install directory
Added support for QT IFW "RemoveTargetDir" boolean option. QTIFW
supports an option to prevent, or not, deletion of the installation
directory. This is a direct pass-through to that variable.
-rw-r--r-- | Help/release/dev/cpackifw-package-remove-target-dir.rst | 6 | ||||
-rw-r--r-- | Modules/CPackIFW.cmake | 6 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 13 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 4 |
4 files changed, 29 insertions, 0 deletions
diff --git a/Help/release/dev/cpackifw-package-remove-target-dir.rst b/Help/release/dev/cpackifw-package-remove-target-dir.rst new file mode 100644 index 0000000..52dfc04 --- /dev/null +++ b/Help/release/dev/cpackifw-package-remove-target-dir.rst @@ -0,0 +1,6 @@ +cpackifw-package-remove-target-dir +---------------------------------- + +* The :module:`CPackIFW` module gained new + :variable:`CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR` variable to control + if the target directory should not be deleted when uninstalling. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 05a54a0..54f6133 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -191,6 +191,12 @@ # # By default used QtIFW_ defaults (``maintenancetool``). # +# .. variable:: CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR +# +# Set to ``OFF`` if the target directory should not be deleted when uninstalling. +# +# Is ``ON`` by default +# # .. variable:: CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE # # Filename for the configuration of the generated maintenance tool. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 422f5d5..bcbe84d 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -93,6 +93,15 @@ void cmCPackIFWInstaller::ConfigureFromOptions() } } + // RemoveTargetDir + if (this->IsSetToOff("CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR")) { + this->RemoveTargetDir = "false"; + } else if (this->IsOn("CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR")) { + this->RemoveTargetDir = "true"; + } else { + this->RemoveTargetDir.clear(); + } + // Logo if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) { if (cmSystemTools::FileExists(option)) { @@ -422,6 +431,10 @@ void cmCPackIFWInstaller::GenerateInstallerFile() xout.Element("MaintenanceToolIniFile", this->MaintenanceToolIniFile); } + if (!this->RemoveTargetDir.empty()) { + xout.Element("RemoveTargetDir", this->RemoveTargetDir); + } + // Different allows if (this->IsVersionLess("2.0")) { // CPack IFW default policy diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index b635f42..37ad339 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -99,6 +99,10 @@ public: /// Set to true if the installation path can contain non-ASCII characters std::string AllowNonAsciiCharacters; + /// Set to false if the target directory should not be deleted when + /// uninstalling + std::string RemoveTargetDir; + /// Set to false if the installation path cannot contain space characters std::string AllowSpaceInPath; |