create powershell script for running qt app on windows

This commit is contained in:
talksik
2026-01-09 16:34:04 -08:00
parent 5215938ebe
commit 947617ef37
2 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
int main(int argc, char *argv[])
{
qDebug() << "Hello world";
qDebug() << "Hello test";
QGuiApplication app(argc, argv);
+22
View File
@@ -0,0 +1,22 @@
# 1. Define variables
$BuildDir = "build"
$Config = "Debug"
# 2. Create the build directory if it doesn't exist
if (-not (Test-Path $BuildDir)) {
New-Item -Path $BuildDir -ItemType Directory
}
# 3. Configure the project
# This is equivalent to 'cmake -B build -S .'
cmake -GNinja -DCMAKE_PREFIX_PATH="C:\Users\arjun\Qt\6.8.6\msvc2022_64" -S . -B $BuildDir
# 4. Build the project
# This works regardless of the generator (Visual Studio, Ninja, etc.)
cmake --build $BuildDir --config $Config
$env:Path += ";C:\Users\arjun\Qt\6.8.6\msvc2022_64\bin"
Write-Host "Build Complete!" -ForegroundColor Green
Start-Process "$BuildDir\appllink.exe" -WorkingDirectory $BuildDir