From 947617ef37e3e93d5edb5aaac2bbfd1d26aeaabe Mon Sep 17 00:00:00 2001 From: talksik Date: Fri, 9 Jan 2026 16:34:04 -0800 Subject: [PATCH] create powershell script for running qt app on windows --- ui/main.cpp | 2 +- ui/run.ps1 | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 ui/run.ps1 diff --git a/ui/main.cpp b/ui/main.cpp index a4dfbc9..f9220fd 100644 --- a/ui/main.cpp +++ b/ui/main.cpp @@ -3,7 +3,7 @@ int main(int argc, char *argv[]) { - qDebug() << "Hello world"; + qDebug() << "Hello test"; QGuiApplication app(argc, argv); diff --git a/ui/run.ps1 b/ui/run.ps1 new file mode 100644 index 0000000..ddae075 --- /dev/null +++ b/ui/run.ps1 @@ -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 +