diff --git a/doc/dev/compiling-on-windows-qt6.rst b/doc/dev/compiling-on-windows-qt6.rst new file mode 100644 index 0000000000000..07a4618ec332c --- /dev/null +++ b/doc/dev/compiling-on-windows-qt6.rst @@ -0,0 +1,90 @@ +Compiling the desktop client on Windows with Qt6 +================================================ + +System requirements +------------------- +- Windows 10 or Windows 11 +- `The desktop client code `_ +- Python 3 +- PowerShell +- Microsoft Visual Studio 2022 and tools to compile C++ +- `KDE Craft `_ + + +Setting up Microsoft Visual Studio +---------------------------------- + +- Click on 'Modify' in the Visual Studio Installer: + + .. image:: ./images/dev/visual-studio-installer.png + :alt: Visual Studio Installer + +- Select 'Desktop development with C++' + + .. image:: ./images/dev/desktop-development-with-cpp.png + :alt: Desktop development with C++ + +Handling the dependencies +------------------------- + +We decided to use `KDE Craft `_ to get all binary dependencies of the desktop client. +because it is convenient to mantain and to set it up. + +- Set up KDE Craft as instructed in `Get Involved/development/Windows - KDE Community Wiki `_ - it requires Python 3 and PowerShell. +- After running: + +.. code-block:: winbatch + + C:\CraftRoot\craft\craftenv.ps1 + +- Add the desktop client blueprints - the instructions to handle the client dependencies: + +.. code-block:: winbatch + + craft --add-blueprint-repository [git]https://github.com/nextcloud/desktop-client-blueprints.git + craft craft + +- Install all client dependencies: + +.. code-block:: winbatch + + craft --install-deps nextcloud-client + +Compiling +--------- + +- Make sure your environment variable %PATH% has the possible minimum +- Open the Command Prompt (cmd.exe) +- Run: + +.. code-block:: winbatch + + "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 + +- To use the tools installed with Visual Studio, you need the following in your %PATH%: + + .. image:: ./images/dev/path.png + :alt: Windows environment variables + +- Alternatively you can use the tools installed with KDE Craft by adding them to %PATH%: + +.. code-block:: winbatch + + set "PATH=C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin;%PATH%" + +.. note:: + C:\CraftRoot is the path used by default by KDE Craft. When you are setting it up you may choose a different folder. + +- Create build folder, run cmake, compile and install: + +.. code-block:: winbatch + + cd + mkdir build + cd build + cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=. -DCMAKE_PREFIX_PATH=C:\CraftRoot -DCMAKE_BUILD_TYPE=RelWithDebInfo + cmake --build . --target install + +After this, you can use `Qt Creator `_ to import the build folder with its configurations to be able to work with the code. + + diff --git a/doc/images/dev/desktop-development-with-cpp.png b/doc/images/dev/desktop-development-with-cpp.png new file mode 100644 index 0000000000000..4d4f0d34f1a3b Binary files /dev/null and b/doc/images/dev/desktop-development-with-cpp.png differ diff --git a/doc/images/dev/path.png b/doc/images/dev/path.png new file mode 100644 index 0000000000000..88f028700c8f6 Binary files /dev/null and b/doc/images/dev/path.png differ diff --git a/doc/images/dev/visual-studio-installer.png b/doc/images/dev/visual-studio-installer.png new file mode 100644 index 0000000000000..23f4f7a4d3474 Binary files /dev/null and b/doc/images/dev/visual-studio-installer.png differ