diff options
author | Brad King <brad.king@kitware.com> | 2022-05-05 13:31:38 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-05-05 13:31:46 (GMT) |
commit | 7d78dcbebbb028c17de38e337942e0df061c6f20 (patch) | |
tree | 52455f6fd669dfb942b3718011f7a7bdf60e2c2d | |
parent | cd20592c6db8437aa74c8e3060b2eec687d84525 (diff) | |
parent | cae7e5e38df6035779f1de473cf3debbc4a9260f (diff) | |
download | CMake-7d78dcbebbb028c17de38e337942e0df061c6f20.zip CMake-7d78dcbebbb028c17de38e337942e0df061c6f20.tar.gz CMake-7d78dcbebbb028c17de38e337942e0df061c6f20.tar.bz2 |
Merge topic 'cpack-wix-arch'
cae7e5e38d CPack/WIX: Add CPACK_WIX_ARCHITECTURE to support Windows for ARM installers
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7236
-rw-r--r-- | Help/cpack_gen/wix.rst | 9 | ||||
-rw-r--r-- | Help/release/dev/cpack-wix-arch.rst | 6 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 13 |
3 files changed, 27 insertions, 1 deletions
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst index e9d5af6..a3d43fc 100644 --- a/Help/cpack_gen/wix.rst +++ b/Help/cpack_gen/wix.rst @@ -328,3 +328,12 @@ Windows using WiX. If this variable is set then the inclusion of WixUIExtensions is skipped, i.e. the ``-ext "WixUIExtension"`` command line is not included during the execution of the WiX light tool. + +.. variable:: CPACK_WIX_ARCHITECTURE + + .. versionadded:: 3.24 + + This variable can be optionally set to specify the target architecture + of the installer. May for example be set to ``x64`` or ``arm64``. + + When unspecified, CPack will default to ``x64`` or ``x86``. diff --git a/Help/release/dev/cpack-wix-arch.rst b/Help/release/dev/cpack-wix-arch.rst new file mode 100644 index 0000000..e7fd1ad --- /dev/null +++ b/Help/release/dev/cpack-wix-arch.rst @@ -0,0 +1,6 @@ +cpack-wix-arch +-------------- + +* The :cpack_gen:`CPack WIX Generator` gained a new variable, + :variable:`CPACK_WIX_ARCHITECTURE`, to specify the installer architecture + in order to support computers running Windows for ARM. diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 6a0095b..594f408 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -89,10 +89,21 @@ bool cmCPackWIXGenerator::RunCandleCommand(std::string const& sourceFile, return false; } + std::string arch; + if (cmValue archOpt = GetOption("CPACK_WIX_ARCHITECTURE")) { + arch = *archOpt; + } else { + arch = GetArchitecture(); + cmCPackLogger( + cmCPackLog::LOG_VERBOSE, + "CPACK_WIX_ARCHITECTURE was not set. Invoking WiX with architecture " + << arch << " . " << std::endl); + } + std::ostringstream command; command << QuotePath(executable); command << " -nologo"; - command << " -arch " << GetArchitecture(); + command << " -arch " << arch; command << " -out " << QuotePath(objectFile); for (std::string const& ext : CandleExtensions) { |