From 52d1c1f34b29a887717afdfe86e6cfea69896af7 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 5 Mar 2024 02:53:59 +0000 Subject: [PATCH] Support CMake 3.28+ in CI jobs on Windows (#6668) * Support building Qt using CMake 3.28+ CMake 3.28 dropped support for deriving installation prefix(es) based on PATH environment variable on Windows. Since all the other built packages already pass necessary prefix path(s) explicitly via CMAKE_PREFIX_PATH and it works for them, do the same for Qt 6 as well. Building Qt 5 isn't affected as it doesn't use CMake. * Fix environment variable name in `windows` build job Using wrong name resulted in empty `CMAKE_PREFIX_PATH` CMake setting value, which showed the effects of CMake 3.28 changes yet again. --- .github/workflows/actions.yml | 2 +- release/windows/build-qt6.ps1 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 0451493a2..9383c14da 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -429,7 +429,7 @@ jobs: -G Ninja ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_INSTALL_PREFIX=pfx ` - -DCMAKE_PREFIX_PATH="${Env:DepsPrefix}" ` + -DCMAKE_PREFIX_PATH="${Env:DEPS_PREFIX}" ` -DENABLE_CLI=${{ (needs.what-to-make.outputs.make-cli == 'true') && 'ON' || 'OFF' }} ` -DENABLE_DAEMON=${{ (needs.what-to-make.outputs.make-daemon == 'true' || needs.what-to-make.outputs.make-dist == 'true') && 'ON' || 'OFF' }} ` -DENABLE_GTK=OFF ` diff --git a/release/windows/build-qt6.ps1 b/release/windows/build-qt6.ps1 index 96b1389d3..ff701f544 100644 --- a/release/windows/build-qt6.ps1 +++ b/release/windows/build-qt6.ps1 @@ -91,6 +91,8 @@ function global:Build-Qt6([string] $PrefixDir, [string] $Arch, [string] $DepsPre '-nomake'; 'tests' '-I'; (Join-Path $DepsPrefixDir include).Replace('\', '/') '-L'; (Join-Path $DepsPrefixDir lib).Replace('\', '/') + '--' + "-DCMAKE_PREFIX_PATH=${DepsPrefixDir}" ) if ($env:LDFLAGS) {