All Categories
  • 1st Steps
  • Authentication
  • Branding
  • Changelogs
  • Collaboration
  • Compliance
  • Customization
  • Desktop Client
  • External Storage
  • Frequently Asked Questions
  • Installation
  • Migrations
  • Mobile Clients
  • Nextcloud Context Chat
  • Nextcloud Flow (Windmill integration)
  • Nextcloud Talk
  • Operations
  • Partner Products
  • Roundcubemail
  • Scalability
  • Security
  • Compiling the desktop client on Windows with Qt6

    System requirements

    Set up Windows 10 or Windows 11

    • If you don't have Windows as your main system, you could try to run it as a virtual machine: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

    Setting up Microsoft Visual Studio

    After installing Microsoft Visual Studio 2022, you will need to install the tools needed to compile C++:

    • Click on 'Modify' in the Visual Studio Installer:

    Visual Studio Installer

    • Select 'Desktop development with C++':

    Desktop development with C++

    Install Inkscape

    • Install the latest version of Inkscape.

    Set up KDE Craft

    We handle the dependencies using KDE Craft because it is easy to set it up and it makes the maintenance much more reliable in all platforms.

    1. You will need to install Python 3: https://www.python.org/downloads/windows/
    2. Set up KDE Craft as instructed in Get Involved/development/Windows - KDE Community Wiki.
    3. Use the default options, including Qt6 (since desktop 3.14, we are using Qt 6).

    ::: info C:\CraftRoot is the path used by default by KDE Craft. When you are setting it up you may choose a different folder: you will need to change from C:\CraftRoot to the path you picked in the next steps listed here. :::

    How to use the desktop client blueprints

    1. After following the instructions in Get Involved/development/Windows - KDE Community Wiki.

    2. Open PowerShell.

    3. Run craftenv.ps1 as described in the instructions above:

    C:\CraftRoot\craft\craftenv.ps1
    
    1. Add the blueprints from this repository:
    craft --add-blueprint-repository https://github.com/nextcloud/desktop-client-blueprints.git
    
    craft craft
    
    1. Install all desktop client dependencies:
    craft --install-deps nextcloud-client
    

    Compiling

    1. Make sure your environment variable %PATH% has no conflicting information to the environment you will use to compile the client. For instance, if you have installed OpenSSL previously and have added it to %PATH%, the OpenSSL installed might be a different version than what was installed via KDE Craft.

    2. To use the tools installed with Visual Studio, you need the following in your %PATH%:

    System Properties > Environment Variables

    1. Open the Command Prompt (cmd.exe)

    2. Run:

    "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
    

    ::: info Alternatively you can use the tools installed with KDE Craft by adding them to %PATH% in your current session:

    set "PATH=C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin;%PATH%"
    

    This will result in using the cmake version downloaded with KDE Craft. :::

    1. Clone the desktop client repository.
    git clone https://github.com/nextcloud/desktop.git
    
    1. Create the build folder <build-folder>.
    mkdir <build-folder>
    
    1. Go into the build folder.
    cd <build-folder>
    
    1. Run cmake.
    cmake ..\<desktop-cloned-repo> -G Ninja -DCMAKE_INSTALL_PREFIX=. -DCMAKE_PREFIX_PATH=C:\CraftRoot -DCMAKE_BUILD_TYPE=RelWithDebInfo
    
    1. Compile the desktop client
    cmake --build .
    

    Now you can use Qt Creator to import the build folder with its configurations to be able to work with the code.