Skip to content

Commit

Permalink
doc: amend Windows build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrts committed Mar 15, 2021
1 parent 35c36ac commit 0763484
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}

0 comments on commit 0763484

Please sign in to comment.