Skip to content

Commit 0763484

Browse files
committed
doc: amend Windows build instructions
1 parent 35c36ac commit 0763484

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ https://github.com/mrts/docker-qt-cmake-gtest-valgrind-ubuntu/blob/master/Docker
168168

169169
.\vcpkg install --recurse --triplet x64-windows --clean-after-build gtest openssl
170170

171-
- Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer), choose _Default Qt 5.15 desktop installation_.
172-
Export _Qt_ directory with e.g. `set Qt5_DIR=C:\qt` before building.
171+
- Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer),
172+
choose _Custom installation > Qt 5.15.2 > MSVC 2019 64-bit_.
173173

174174
### macOS
175175

@@ -194,3 +194,44 @@ https://github.com/mrts/docker-qt-cmake-gtest-valgrind-ubuntu/blob/master/Docker
194194
./build.sh
195195
./test.sh
196196
./build/src/app/web-eid -c get-certificate '{"type":"auth", "origin":"https://ria.ee"}'
197+
198+
### Building and testing in Windows
199+
200+
Use _Powershell_ to run the following commands to build the project.
201+
202+
- Set the _Qt_ installation directory variable:
203+
204+
$QT_ROOT = "C:\Qt\5.15.2\msvc2019_64"
205+
206+
- Set the _Qt_ _CMake_ directory environment variable:
207+
208+
$env:Qt5_DIR = "${QT_ROOT}\lib\cmake\Qt5"
209+
210+
- Set the _vcpkg_ installation directory variable:
211+
212+
$VCPKG_ROOT = "C:\vcpkg"
213+
214+
- Set the build type variable:
215+
216+
$BUILD_TYPE = "RelWithDebInfo"
217+
218+
- Make the build directory and run _CMake_:
219+
220+
mkdir build
221+
cd build
222+
cmake -A x64 `
223+
"-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" `
224+
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" ..
225+
226+
- Run the build and installer build:
227+
228+
cmake --build . --config ${BUILD_TYPE}
229+
cmake --build . --config ${BUILD_TYPE} --target installer
230+
231+
- Add _Qt_ binary directory to path:
232+
233+
$env:PATH += "${QT_ROOT}\bin"
234+
235+
- Run tests:
236+
237+
ctest -V -C ${BUILD_TYPE}

0 commit comments

Comments
 (0)