summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-05-19 17:40:22 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-19 19:25:55 (GMT)
commit4c7c66dcf542af7f9d4f0632cfebc499c58602b7 (patch)
treeedf953c092f2b454779d5b12b64ad1e90068cac7 /.gitlab/ci
parent729ee30c2eb627808f64199e3337fe7b0fcf8a74 (diff)
downloadCMake-4c7c66dcf542af7f9d4f0632cfebc499c58602b7.zip
CMake-4c7c66dcf542af7f9d4f0632cfebc499c58602b7.tar.gz
CMake-4c7c66dcf542af7f9d4f0632cfebc499c58602b7.tar.bz2
gitlab-ci: Add jobs to make Windows x86_64 and i386 packages
Run CPack in a separate job for nightly binaries, and not at all for release binaries. Unlike macOS disk images (.dmg), we cannot sign the binaries inside Windows installers (.msi) after-the-fact. Instead, produce enough artifacts from the build job to sign and package release binaries manually. Port build settings from `Utilities/Release/win/x86/Dockerfile` and its helper scripts.
Diffstat (limited to '.gitlab/ci')
-rw-r--r--.gitlab/ci/configure_windows_i386_package.cmake9
-rw-r--r--.gitlab/ci/configure_windows_package_common.cmake35
-rw-r--r--.gitlab/ci/configure_windows_x86_64_package.cmake9
-rw-r--r--.gitlab/ci/download_qt.cmake14
-rw-r--r--.gitlab/ci/download_qt_hashes.cmake3
5 files changed, 69 insertions, 1 deletions
diff --git a/.gitlab/ci/configure_windows_i386_package.cmake b/.gitlab/ci/configure_windows_i386_package.cmake
new file mode 100644
index 0000000..279f5cf
--- /dev/null
+++ b/.gitlab/ci/configure_windows_i386_package.cmake
@@ -0,0 +1,9 @@
+# CPack package file name component for this platform.
+set(CPACK_SYSTEM_NAME "windows-i386" CACHE STRING "")
+
+# Use APIs from at most Windows 7
+set(CMAKE_C_FLAGS "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-GR -EHsc -D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
+set(CMAKE_EXE_LINKER_FLAGS "-machine:x86 -subsystem:console,6.01" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_package_common.cmake")
diff --git a/.gitlab/ci/configure_windows_package_common.cmake b/.gitlab/ci/configure_windows_package_common.cmake
new file mode 100644
index 0000000..cea0ba0
--- /dev/null
+++ b/.gitlab/ci/configure_windows_package_common.cmake
@@ -0,0 +1,35 @@
+set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "")
+
+# Set up install destinations as expected by the packaging scripts.
+set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "")
+
+# Link C/C++ runtime library statically.
+set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "")
+
+# Enable cmake-gui with static qt plugins
+set(BUILD_QtDialog "TRUE" CACHE BOOL "")
+set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "")
+set(qt "$ENV{CI_PROJECT_DIR}/.gitlab/qt")
+set(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES
+ ${qt}/plugins/platforms/qwindows.lib
+ ${qt}/plugins/styles/qwindowsvistastyle.lib
+ ${qt}/lib/Qt5EventDispatcherSupport.lib
+ ${qt}/lib/Qt5FontDatabaseSupport.lib
+ ${qt}/lib/Qt5ThemeSupport.lib
+ ${qt}/lib/qtfreetype.lib
+ ${qt}/lib/qtlibpng.lib
+ imm32.lib
+ wtsapi32.lib
+ CACHE STRING "")
+set(CMAKE_PREFIX_PATH "${qt}" CACHE STRING "")
+
+# Disable ccmake.
+set(BUILD_CursesDialog "OFF" CACHE BOOL "")
+
+set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "")
+set(CMake_TEST_Java OFF CACHE BOOL "")
+set(CMake_TEST_Qt5 OFF CACHE BOOL "")
+set(CMake_TEST_Qt6 OFF CACHE BOOL "")
+set(Python_FIND_REGISTRY NEVER CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_windows_x86_64_package.cmake b/.gitlab/ci/configure_windows_x86_64_package.cmake
new file mode 100644
index 0000000..b7bba85
--- /dev/null
+++ b/.gitlab/ci/configure_windows_x86_64_package.cmake
@@ -0,0 +1,9 @@
+# CPack package file name component for this platform.
+set(CPACK_SYSTEM_NAME "windows-x86_64" CACHE STRING "")
+
+# Use APIs from at most Windows 7
+set(CMAKE_C_FLAGS "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-GR -EHsc -D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000" CACHE STRING "")
+set(CMAKE_EXE_LINKER_FLAGS "-machine:x64 -subsystem:console,6.01" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_package_common.cmake")
diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake
index 5940a28..90c2187 100644
--- a/.gitlab/ci/download_qt.cmake
+++ b/.gitlab/ci/download_qt.cmake
@@ -11,7 +11,19 @@ set(qt_version_nodot "${qt_version_major}${qt_version_minor}${qt_version_patch}"
# Files needed to download.
set(qt_files)
-if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows")
+if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows.*package")
+ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_x86_64_package")
+ list(APPEND qt_files "qt-5.12.1-win-x86_64-msvc_v142-1.zip")
+ set(qt_subdir "qt-5.12.1-win-x86_64-msvc_v142-1")
+ elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows_i386_package")
+ list(APPEND qt_files "qt-5.12.1-win-i386-msvc_v142-1.zip")
+ set(qt_subdir "qt-5.12.1-win-i386-msvc_v142-1")
+ else ()
+ message(FATAL_ERROR "Unknown arch to use for Qt")
+ endif()
+ set(qt_url_root "https://cmake.org/files/dependencies")
+ set(qt_url_path "")
+elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows")
# Determine the ABI to fetch for Qt.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2015")
set(qt_platform "windows_x86")
diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake
index afbc081..d19d284 100644
--- a/.gitlab/ci/download_qt_hashes.cmake
+++ b/.gitlab/ci/download_qt_hashes.cmake
@@ -12,3 +12,6 @@ set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_6
set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1)
set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b)
+
+set("qt-5.12.1-win-i386-msvc_v142-1.zip_hash" aa78711fdaa5d9b146bf7ddcf15983f9fbb3f995462f2d043f8cca74b40ddd11)
+set("qt-5.12.1-win-x86_64-msvc_v142-1.zip_hash" c2fc068b9dac40bb420e28e1ee15ce4f2ccfc866d767f3b99b6bb435b7c4f44b)