Support Windows zip and NSIS package generation in MSYS2.

This commit is contained in:
Alexander Shaduri
2021-03-11 18:06:06 +04:00
parent 2d83424510
commit d7978e759d
+31 -10
View File
@@ -92,8 +92,8 @@ else()
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
endif()
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}\\\\packaging\\\\nsis\\\\nsis_install.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}\\\\packaging\\\\nsis\\\\nsis_uninstall.ico")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}\\\\packaging\\\\nsis\\\\nsi_install.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}\\\\packaging\\\\nsis\\\\nsi_uninstall.ico")
set(CPACK_NSIS_HELP_LINK "${PROJECT_HOMEPAGE_URL}")
set(CPACK_NSIS_URL_INFO_ABOUT "${PROJECT_HOMEPAGE_URL}")
@@ -128,22 +128,44 @@ if (WIN32)
option(APP_WINDOWS_SYSROOT "Location of system root for Windows binaries, for packing" "")
if (NOT APP_WINDOWS_SYSROOT)
set(APP_WINDOWS_SYSROOT "${CMAKE_FIND_ROOT_PATH}")
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(APP_WINDOWS_SYSROOT "c:\\msys64\\mingw64")
else()
set(APP_WINDOWS_SYSROOT "c:\\msys64\\mingw32")
endif()
file(TO_CMAKE_PATH "${APP_WINDOWS_SYSROOT}" APP_WINDOWS_SYSROOT)
else() # Cross-compiling
set(APP_WINDOWS_SYSROOT "${CMAKE_FIND_ROOT_PATH}")
endif()
endif()
message(STATUS "APP_WINDOWS_SYSROOT: ${APP_WINDOWS_SYSROOT}")
option(APP_WINDOWS_GTK_ICONS_ROOT "Location of root folder for icons, for packing Windows packages" "")
if (NOT APP_WINDOWS_GTK_ICONS_ROOT)
set(APP_WINDOWS_GTK_ICONS_ROOT "/usr/share/icons")
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(APP_WINDOWS_GTK_ICONS_ROOT "${APP_WINDOWS_SYSROOT}/share/icons")
else() # Cross-compiling
set(APP_WINDOWS_GTK_ICONS_ROOT "/usr/share/icons")
endif()
endif()
message(STATUS "APP_WINDOWS_GTK_ICONS_ROOT: ${APP_WINDOWS_GTK_ICONS_ROOT}")
option(APP_WINDOWS_SMARTCTL_ROOT "Location of root folder for icons, for packing Windows packages" "")
option(APP_WINDOWS_SMARTCTL_ROOT "Location of root folder for smartctl, for packing Windows packages" "")
if (NOT APP_WINDOWS_SMARTCTL_ROOT)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(APP_WINDOWS_SMARTCTL_ROOT "$ENV{HOME}/.wine/drive_c/Program Files/smartmontools")
else()
set(APP_WINDOWS_SMARTCTL_ROOT "$ENV{HOME}/.wine/drive_c/Program Files (x86)/smartmontools")
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(APP_WINDOWS_SMARTCTL_ROOT "C:\\Program Files\\smartmontools")
else()
set(APP_WINDOWS_SMARTCTL_ROOT "C:\\Program Files (x86)\\smartmontools")
endif()
file(TO_CMAKE_PATH "${APP_WINDOWS_SMARTCTL_ROOT}" APP_WINDOWS_SMARTCTL_ROOT)
else() # Cross-compiling
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(APP_WINDOWS_SMARTCTL_ROOT "$ENV{HOME}/.wine/drive_c/Program Files/smartmontools")
else()
set(APP_WINDOWS_SMARTCTL_ROOT "$ENV{HOME}/.wine/drive_c/Program Files (x86)/smartmontools")
endif()
endif()
endif()
message(STATUS "APP_WINDOWS_SMARTCTL_ROOT: ${APP_WINDOWS_SMARTCTL_ROOT}")
@@ -226,7 +248,6 @@ if (WIN32)
foreach(pattern ${GTK_FILES})
file(GLOB MATCHED_FILES
LIST_DIRECTORIES false
RELATIVE "${APP_WINDOWS_SYSROOT}/bin"
"${APP_WINDOWS_SYSROOT}/bin/${pattern}"
)
message(STATUS "Matched files in ${APP_WINDOWS_SYSROOT}/bin for ${pattern}: ${MATCHED_FILES}")