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.
This commit is contained in:
Mike Gelfand 2024-03-05 02:53:59 +00:00 committed by GitHub
parent 34b8c827a8
commit 52d1c1f34b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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 `

View File

@ -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) {