These are common steps to build Notes from source on Windows.
Windows 10 21H2 (1809 or later) is required to build Notes.
Additionally, you need to install the following tools/components:
- Git
- Microsoft Visual C++
>= 2017
(only the build tools are required) - Qt
>= 6.0
(using the latest version is recommended)
Please refer to build_options.md.
The following steps are done all via the command line. If you're not that comfortable with it, you can also to configure the project using a graphical tool like the CMake GUI, or Qt Creator.
Additionally, these commands are meant to be run on the Windows command prompt, not on PowerShell (though they can be easily adapted).
First, use git
to clone the project and its components, and then navigate into it:
git clone https://github.com/nuttyartist/notes.git --recurse-submodules
cd notes
Now, let's configure our build environment. In this example, we will be using Microsoft Visual C++ 2017 and Qt 6.4.3 (the MSVC 2019 build), targeting a 64-bit system.
Depending on what versions of these applications you have installed, you may need to make some path adjustments in the following steps.
Let's begin by invoking the vcvars64.bat
script from MSVC 2017, which will set some helpful environment variables for us:
@call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
Now, we need to add CMake, Ninja, Qt sources and tools to our Path
environment variable:
set Path=C:\Qt\Tools\CMake_64\bin;%Path%
set Path=C:\Qt\Tools\Ninja;%Path%
set Path=C:\Qt\6.4.3\msvc2019_64;%Path%
set Path=C:\Qt\6.4.3\msvc2019_64\bin;%Path%
Optionally, if you want to dedicate all cores of your CPU to build Notes much faster, set this environment variable:
set CMAKE_BUILD_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%
After that, we're ready to build Notes!
Invoke CMake to configure and build the project into a folder called build
, in Release
mode:
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
Now, let's move the Notes.exe
executable we just built into a separate folder called bin
inside the build
folder, where later we will copy other libraries required to run the app:
cmake --install build --prefix build
Now, use the windeployqt
tool from Qt to copy the required Qt libraries to run Notes:
windeployqt --qmldir src\qml build\bin
And then, finally, copy the required OpenSSL libraries to make internet-dependent features work properly (like the auto-updater):
copy /B C:\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll build\bin
copy /B C:\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll build\bin
You can now run Notes by double-clicking the Notes.exe
executable in the build\bin
folder.