cmake: add prefixed cpack and CPACK_NSIS_EXECUTABLE

see #1502
This commit is contained in:
Tony Theodore 2017-08-15 15:44:59 +10:00
parent a008e046c6
commit 3631f2f307
3 changed files with 25 additions and 1 deletions

View File

@ -30,7 +30,6 @@ see also:
https://gitlab.kitware.com/cmake/cmake/issues/16291
https://gitlab.kitware.com/cmake/cmake/issues/16919
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 1111111..2222222 100644
--- a/Modules/Compiler/GNU.cmake
@ -44,3 +43,25 @@ index 1111111..2222222 100644
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
endif()
endmacro()
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Tue, 15 Aug 2017 15:25:06 +1000
Subject: [PATCH] add CPACK_NSIS_EXECUTABLE variable
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 1111111..2222222 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -384,7 +384,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(

View File

@ -36,6 +36,8 @@ define $(PKG)_BUILD
-DINPUT='$(PWD)/src/cmake/conf/target-cmake.in' \
-DOUTPUT='$(PREFIX)/bin/$(TARGET)-cmake'
chmod 0755 '$(PREFIX)/bin/$(TARGET)-cmake'
ln -sf '$(PREFIX)/$(BUILD)/bin/cpack' '$(PREFIX)/bin/$(TARGET)-cpack'
endef
define $(PKG)_BUILD_$(BUILD)

View File

@ -56,6 +56,7 @@ set(CMAKE_Fortran_COMPILER @PREFIX@/bin/@TARGET@-gfortran)
set(CMAKE_RC_COMPILER @PREFIX@/bin/@TARGET@-windres)
# CMAKE_RC_COMPILE_OBJECT is defined in:
# <cmake root>/share/cmake-X.Y/Modules/Platform/Windows-windres.cmake
set(CPACK_NSIS_EXECUTABLE @TARGET@-makensis)
## Individual package configuration
file(GLOB mxe_cmake_files