diff --git a/README.md b/README.md index 1036f6d0..a9041825 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ https://github.com/mrts/docker-qt-cmake-gtest-valgrind-ubuntu/blob/master/Docker .\vcpkg install --recurse --triplet x64-windows --clean-after-build gtest openssl -- Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer), choose _Default Qt 5.15 desktop installation_. - Export _Qt_ directory with e.g. `set Qt5_DIR=C:\qt` before building. +- Install _Qt_ with the official [_Qt Online Installer_](https://www.qt.io/download-qt-installer), + choose _Custom installation > Qt 5.15.2 > MSVC 2019 64-bit_. ### macOS @@ -194,3 +194,44 @@ https://github.com/mrts/docker-qt-cmake-gtest-valgrind-ubuntu/blob/master/Docker ./build.sh ./test.sh ./build/src/app/web-eid -c get-certificate '{"type":"auth", "origin":"https://ria.ee"}' + +### Building and testing in Windows + +Use _Powershell_ to run the following commands to build the project. + +- Set the _Qt_ installation directory variable: + + $QT_ROOT = "C:\Qt\5.15.2\msvc2019_64" + +- Set the _Qt_ _CMake_ directory environment variable: + + $env:Qt5_DIR = "${QT_ROOT}\lib\cmake\Qt5" + +- Set the _vcpkg_ installation directory variable: + + $VCPKG_ROOT = "C:\vcpkg" + +- Set the build type variable: + + $BUILD_TYPE = "RelWithDebInfo" + +- Make the build directory and run _CMake_: + + mkdir build + cd build + cmake -A x64 ` + "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" ` + "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" .. + +- Run the build and installer build: + + cmake --build . --config ${BUILD_TYPE} + cmake --build . --config ${BUILD_TYPE} --target installer + +- Add _Qt_ binary directory to path: + + $env:PATH += "${QT_ROOT}\bin" + +- Run tests: + + ctest -V -C ${BUILD_TYPE}