feat(CmakePreset): add presets for every platform

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2023-07-31 21:24:37 -07:00
parent 3587e728d4
commit cd4b7a8a7b
No known key found for this signature in database
GPG Key ID: E10E321EB160949B
3 changed files with 290 additions and 2 deletions

View File

@ -20,7 +20,8 @@
"CMAKE_PREFIX_PATH": "${sourceDir}/libraries/Qt/6.5.1/msvc2019_64/lib/cmake",
"Launcher_BUILD_ARTIFACT": "Windows-MSVC-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL"
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"FORCE_BUNDLED_LIBS": "ON"
},
"environment": {
"CXX_FLAGS": ""
@ -41,6 +42,7 @@
"Launcher_BUILD_ARTIFACT": "Windows-MSVC-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"FORCE_BUNDLED_LIBS": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
@ -61,7 +63,214 @@
"CMAKE_PREFIX_PATH": "${sourceDir}/libraries/Qt/6.5.1/msvc2019_64/lib/cmake",
"Launcher_BUILD_ARTIFACT": "Windows-MSVC-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL"
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"ENABLE_LTO": "ON",
"FORCE_BUNDLED_LIBS": "ON"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "windows_legacy_debug",
"displayName": "MSVC x86 Qt5 Release",
"description": "MSVC x85 Qt5 release build Visual Studio generator",
"generator": "Visual Studio 17 2022",
"architecture": "win32",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"CMAKE_PREFIX_PATH": "${sourceDir}/libraries/Qt/5.15.2/msvc2019/lib/cmake",
"Launcher_BUILD_ARTIFACT": "Windows-Legacy-MSVC-Qt5",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"FORCE_BUNDLED_LIBS": "ON"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "windows_legacy_release",
"displayName": "MSVC x86 Qt5 Release",
"description": "MSVC x85 Qt5 release build Visual Studio generator",
"generator": "Visual Studio 17 2022",
"architecture": "win32",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"CMAKE_PREFIX_PATH": "${sourceDir}/libraries/Qt/5.15.2/msvc2019/lib/cmake",
"Launcher_BUILD_ARTIFACT": "Windows-Legacy-MSVC-Qt5",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL",
"ENABLE_LTO": "ON",
"FORCE_BUNDLED_LIBS": "ON"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "macos_default",
"displayName": "MacOS Debug Ninja",
"description": "MacOS build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "6",
"Launcher_BUILD_ARTIFACT": "MacOS-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "macos_release",
"displayName": "MacOS Debug Ninja",
"description": "MacOS build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "6",
"Launcher_BUILD_ARTIFACT": "MacOS-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"ENABLE_LTO": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "macos_legacy_debug",
"displayName": "MacOS Qt5 Debug Ninja",
"description": "MacOS Qt5 build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"Launcher_BUILD_ARTIFACT": "MacOS-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "macos_legacy_release",
"displayName": "MacOS Qt5 Release Ninja",
"description": "MacOS Qt5 release build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"Launcher_BUILD_ARTIFACT": "MacOS-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
"ENABLE_LTO": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "linux_default",
"displayName": "Linux Debug Ninja",
"description": "Linux build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "6",
"Launcher_BUILD_ARTIFACT": "Linux-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "linux_release",
"displayName": "Linux Release Ninja",
"description": "Linux build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "6",
"Launcher_BUILD_ARTIFACT": "Linux-Qt6",
"Launcher_BUILD_PLATFORM": "custom",
"ENABLE_LTO": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "linux_qt5_debug",
"displayName": "Linux Qt5 Debug Ninja",
"description": "Linux Qt5 build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"Launcher_BUILD_ARTIFACT": "Linux-Qt5",
"Launcher_BUILD_PLATFORM": "custom",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
},
"vendor": {}
},
{
"name": "linux_qt5_release",
"displayName": "Linux Qt5 Release Ninja",
"description": "Linux Qt5 build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "install",
"Launcher_QT_VERSION_MAJOR": "5",
"Launcher_BUILD_ARTIFACT": "Linux-Qt5",
"Launcher_BUILD_PLATFORM": "custom",
"ENABLE_LTO": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "yes"
},
"environment": {
"CXX_FLAGS": ""
@ -81,6 +290,46 @@
{
"name": "windows_release",
"configurePreset": "windows_release"
},
{
"name": "windows_legacy_debug",
"configurePreset": "windows_legacy_debug"
},
{
"name": "windows_legacy_release",
"configurePreset": "windows_legacy_release"
},
{
"name": "macos_default",
"configurePreset": "macos_default"
},
{
"name": "macos_release",
"configurePreset": "macos_release"
},
{
"name": "macos_legacy_debug",
"configurePreset": "macos_legacy_debug"
},
{
"name": "macos_legacy_release",
"configurePreset": "macos_legacy_release"
},
{
"name": "linux_default",
"configurePreset": "linux_default"
},
{
"name": "linux_release",
"configurePreset": "linux_release"
},
{
"name": "linux_qt5_debug",
"configurePreset": "linux_qt5_debug"
},
{
"name": "linux_qt5_release",
"configurePreset": "linux_qt5_release"
}
],
"testPresets": [
@ -94,6 +343,28 @@
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "macos_default",
"configurePreset": "macos_default",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "linux_default",
"configurePreset": "linux_default",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
}
]
}

View File

@ -12,6 +12,7 @@ $system_arch = (Get-CimInstance -Class Win32_ComputerSystem).SystemType
$qt_arch = Switch ($system_arch) {
{$_ -match "x64" } { "win64_msvc2019_64" }
{$_ -match "ARM" } { "win64_msvc2019_arm64" }
default { throw "System architecture unsupported by this script." }
}
$aqt_install_args = @("install-qt", "windows", "desktop", $qt_ver, $qt_arch, "-m", "all", "--outputdir", $qt_path )

16
libraries/installQt5.ps1 Normal file
View File

@ -0,0 +1,16 @@
$aqt_url = "https://github.com/miurahr/aqtinstall/releases/latest/download/aqt.exe"
$qt_path = ( Join-Path -Path "$PSScriptRoot" -ChildPath "Qt" )
New-Item -ItemType Directory -Path $qt_path -ErrorAction SilentlyContinue
$aqt_path = ( Join-Path -Path $qt_path -ChildPath "aqt.exe" )
if (!(Test-Path -Path $aqt_path)) {
Invoke-WebRequest -Uri $aqt_url -OutFile $aqt_path
}
$qt_ver = "5.15.2"
$qt_arch = "win32_msvc2019"
$aqt_install_args = @("install-qt", "windows", "desktop", $qt_ver, $qt_arch, "-m", "all", "--outputdir", $qt_path )
$p = Start-Process -FilePath $aqt_path -ArgumentList $aqt_install_args -Wait