create powershell script for running qt app on windows
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
qDebug() << "Hello world";
|
qDebug() << "Hello test";
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
|||||||
+22
@@ -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
|
||||||
|
|
||||||
Reference in New Issue
Block a user