From 8e8b99d01a6b2ce266a9401f760f4814a69e4853 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Sun, 21 Feb 2021 16:29:11 +0100 Subject: CPack/NSIS: Add option for setting custom makensis executable It allows users to set a custom one without changing the PATH environment variable. Fixes: #21733 --- Help/cpack_gen/nsis.rst | 6 ++++++ Help/release/dev/cpack-nsis-executable-name.rst | 6 ++++++ Source/CPack/cmCPackNSISGenerator.cxx | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/cpack-nsis-executable-name.rst diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst index eaef8ae..964f629 100644 --- a/Help/cpack_gen/nsis.rst +++ b/Help/cpack_gen/nsis.rst @@ -193,3 +193,9 @@ on Windows Nullsoft Scriptable Install System. .. versionadded:: 3.20 If set, trim down the size of the control to the size of the branding text string. + +.. variable:: CPACK_NSIS_EXECUTABLE + + .. versionadded:: 3.21 + + If set, specify the name of the NSIS executable. Default is ``makensis``. diff --git a/Help/release/dev/cpack-nsis-executable-name.rst b/Help/release/dev/cpack-nsis-executable-name.rst new file mode 100644 index 0000000..a3818db --- /dev/null +++ b/Help/release/dev/cpack-nsis-executable-name.rst @@ -0,0 +1,6 @@ +cpack-nsis-executable-name +-------------------------- + +* The :cpack_gen:`CPack NSIS Generator` gained a new variable + :variable:`CPACK_NSIS_EXECUTABLE` to specify the makensis + executable to use instead of the default one. diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 263adfd..9b00704 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -430,7 +430,9 @@ int cmCPackNSISGenerator::InitializeInternal() } #endif - nsisPath = cmSystemTools::FindProgram("makensis", path, false); + this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLE", "makensis"); + nsisPath = cmSystemTools::FindProgram( + this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); if (nsisPath.empty()) { cmCPackLogger( -- cgit v0.12