Skip to content

How to compile the desktop client

Elsie Hupp edited this page Mar 1, 2021 · 21 revisions

Note: This document is in the process of being merged with the official documentation and may be out of date. For the most up-to-date version of the build instructions, visit the source version of the official documentation page here.

Step by step instructions

1. Clone the repo

You have two possibilities to clone the repo.

First option is as remote URL -- you can choose between cloning with HTTPS (which is recommended) or with SSH.

https://github.com/nextcloud/desktop.git

If you don't have an SSH key added to your GitHub account, or are not part of the Nextcloud Github organisation, clone with HTTPS:

$ git clone git@github.com:nextcloud/desktop.git

2. Create build directory:

$ cd desktop
$ mkdir build

3. Compile and install

:information_source: Optional - depending on how you have your dev environment set up, you might need to define those paths as cmake flags or as environment variables:

  • QTKEYCHAIN_LIBRARY
  • QTKEYCHAIN_INCLUDE_DIR
  • OPENSSL_ROOT_DIR
  • OPENSSL_INCLUDE_DIR

:information_source: You can enable the build of the tests by setting the cmake flag BUILD_TESTING to 1.

:information_source: The cmake flag CMAKE_BUILD_TYPE has Debug and Release as options.

:warning: For development reasons it is better to install the client on user space instead on the global system. Mixing up libs/dll's of different version can lead to undefined behavior and crashes:

  • You could use the cmake flag CMAKE_INSTALL_PREFIX as ~/.local/ in a Linux system. If you want to install system wide you could use /usr/local or /opt/nextcloud/.

  • On Windows 10 $USERPROFILE refers to C:\Users\<USERNAME>.

:penguin: Linux

Generate the build files:

$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug

Compile and install:

$ make install

:door: Windows

3.2.1 Generate the build files:

$ cmake "-GVisual Studio 15 2017 Win64" .. -DCMAKE_INSTALL_PREFIX=$USERPROFILE\nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug

3.2.2 Compile and install:

$ cmake --build . --config Debug --target install

:apple: Mac OS

Enable git submodules:

$ cd desktop
$ git submodule init
$ git submodule update

Generate the build files:

$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug 

Compile and install:

$ make install