Skip to content

Commit d2889da

Browse files
authored
Windows local build scripts (#468)
1 parent 96550b3 commit d2889da

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ compile_commands.json
1212
.vscode
1313
.clangd
1414
.cache
15+
Qt/**
16+
aqtinstall.log

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- [Dependencies](#dependencies)
2929
- [Building](#building)
3030
- [Windows](#windows)
31+
- [PowerShell](#powershell-installation-scripts)
3132
- [Linux](#linux)
3233
- [OS X](#os-x)
3334

@@ -93,6 +94,17 @@ Power Tab Editor 2.0 - A powerful cross platform guitar tablature viewer and edi
9394
* Open the project folder in Visual Studio and build.
9495
* If running CMake manually, set `CMAKE_TOOLCHAIN_FILE` to `[vcpkg root]\scripts\buildsystems\vcpkg.cmake`
9596

97+
##### PowerShell Installation Scripts
98+
* For a more installation streamlined process
99+
- with at least PowerShell 5.1 is installed on your machine
100+
- Run these powershell scripts in your powershell terminal with your shell working directory as your cloned project
101+
```powershell
102+
.\scripts\Get-Dependencies.ps1 -vcpkg_exe_path "your/path/to/your/vcpkg.exe" -python_exe_path "your/path/to/your/python.exe";
103+
.\scripts\Run-CMakeBuild.ps1 -vcpkg_dir "your/path/to/your/vcpkg" -qt_path "your/path/to/qt";
104+
```
105+
You'll have to update the variables for your specific paths to `$vcpkg_exe_path`, `$python_exe_path`, and `$qt_path`
106+
107+
96108
#### Linux:
97109
* These instructions assume a recent Ubuntu/Debian-based system, but the package names should be similar for other package managers.
98110
* Install dependencies:

scripts/Get-Dependencies.ps1

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
param(
2+
[string]
3+
$vcpkg_exe_path = "C:\Program Files\vcpkg\vcpkg.exe",
4+
5+
[string]
6+
$python_exe_path = "$($HOME)\AppData\Local\Programs\Python\Python39\python.exe"
7+
)
8+
9+
if (!(Test-Path $python_exe_path)) {
10+
throw "python exe path not found please update to your path to python";
11+
}
12+
13+
if (!(Test-Path $vcpkg_exe_path)) {
14+
throw "vcpkg exe path not found please update to your path to vcpkg and/or install vcpkg first";
15+
}
16+
17+
& $vcpkg_exe_path install --triplet x64-windows boost-algorithm boost-date-time boost-endian boost-functional boost-iostreams boost-rational boost-signals2 boost-stacktrace doctest minizip nlohmann-json pugixml;
18+
19+
& $python_exe_path -m pip install setuptools wheel py7zr==0.20.*;
20+
21+
& $python_exe_path -m pip install aqtinstall==3.1.*;
22+
23+
& $python_exe_path -m aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 --outputdir "$($PSScriptRoot)\..\Qt";

scripts/Run-CMakeBuild.ps1

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
param(
2+
[string]
3+
$vcpkg_dir = "C:\Program Files\vcpkg\",
4+
5+
[string]
6+
$qt_path = "$($PSScriptRoot)/../Qt"
7+
)
8+
9+
if (!(Test-Path "$vcpkg_dir")) {
10+
throw "could not find the vcpkg directory please update this value with your path to vcpkg directory";
11+
}
12+
13+
if (!(Test-Path "$qt_path")) {
14+
throw "Qt dependency is not installed yet, for this script to work install Qt to this project's root directory or change the path to your Qt installation";
15+
}
16+
17+
$qt5_widgets_cmake_path = "$($qt_path)/5.15.2/msvc2019_64/lib/cmake/Qt5Widgets/";
18+
$qt5_network_cmake_path = "$($qt_path)/5.15.2/msvc2019_64/lib/cmake/Qt5Network/";
19+
$qt5_printsupport_cmake_path = "$($qt_path)/5.15.2/msvc2019_64/lib/cmake/Qt5PrintSupport/";
20+
$qt5_linguisttools_cmake_path = "$($qt_path)/5.15.2/msvc2019_64/lib/cmake/Qt5LinguistTools";
21+
22+
<#
23+
https://cmake.org/cmake/help/latest/envvar/CMAKE_PREFIX_PATH.html#envvar:CMAKE_PREFIX_PATH
24+
#>
25+
$cmake_prefix_path = $(
26+
@(
27+
$qt5_widgets_cmake_path,
28+
$qt5_network_cmake_path,
29+
$qt5_printsupport_cmake_path,
30+
$qt5_linguisttools_cmake_path
31+
# probably a unix system as per cmake documentation are colon separated
32+
) -join $(if ($env:OS -match "Windows") {";"} else {":"})
33+
);
34+
35+
36+
cmake `
37+
-A x64 `
38+
-B ./build `
39+
-DPTE_ENABLE_PCH=1 `
40+
-DCMAKE_TOOLCHAIN_FILE="$($vcpkg_dir)/scripts/buildsystems/vcpkg.cmake" `
41+
-DCMAKE_PREFIX_PATH="$($cmake_prefix_path)"

0 commit comments

Comments
 (0)