-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Building
Warning
WIP: These instructions are a work in progress. Building (legacy)
Deskflow is free and open source software, and anyone is welcome to build it, run it, tinker with it, fork it, redistribute it as part of their own app, etc.
Before we can begin building, we need to set up the development environment.
Getting started on Windows requires you first have the following tools installed and in your PATH
-
Visual Studio Community or Visual Studio 2022
- Install at least the following VS components:
- MSVC v143 - VS 2022 C++ x64 / x86 build tools
- A Windows SDK for example I am using
Windows 10 SDK (10.0.18362.0)
- Install at least the following VS components:
-
cmake - CMake v3.24 or higher is needed
-
vcpkg - Recommended for dependency management:
- Clone
vcpkgtoC:\vcpkg(names can get long and Windows has a path limit) - After you have
vcpkg.exeinC:\vcpkgbe sure to runvcpkg integrate install - Note the "toolchain" it tells you to use for CMake; we will need this to configure.
- Be sure to add
%VCPKG_ROOT%to yourPATHenv var.
- Clone
Tip: Initial configuration using vcpkg can take awhile since it will checkout and build all dependencies this is the easiest way to configure the project on windows. If you do not want to build a dependency (or any of them) You must
- Edit the
vcpkg.configfile to remove the items you do will install manually, This must happen before you attempt to configure the project. OR when configuring the project without CMAKE_TOOLCHAIN_FILE set to the vcpkg toolchain. - Install the item manually and make sure that cmake can find it, usually this involves adding the path where the projects *.cmake file is located to your PATH
- In the case of Qt also add the path of the qt tools to your PATH
Getting started on macOS you will need to have the following tools
- XCode - App Store - You must open it after installing and install the SDK for the version of macOS you have.
- Homebrew
- Git
- CMake 3.24
- Qt 6
Tip: Once you have installed brew, run this command
brew install git cmake
You should have at lest the basic items to build C++ code:
- gcc or clang
- cmake 3.24+
- git
- ninja build tool (recommended)
Use your package manager to install these.
Deskflow requires the following to build:
- CMake 3.24+
- Qt 6.7+
- OpenSSL 3.0
- Google Test**
- libportal 0.9.1+ (Linux only)
- libei 1.3+ (Linux only)
** These dependencies will be downloaded automatically at build time if they are not found on your system, Google Test is only needed to build tests.
If you have installed vcpkg when using either Qt Creator or Visual Studio Code it should automatically detect your vcpkg info. If it does not you will need to set your CMAKE_TOOLCHAIN_FILE. Once vcpkg has been setup it will download and build the needed dependencies when you run the configuration command. It will take a while to build things the first time, which is normal.
The following items will be installed by vcpkg: qt, openssl, and gtest.
- Qt 6.7+
- If you only plan to run the build on your local system you can use thebrewversion of Qt (brew install qt) - If you want to distribute your builds you need to get Qt from the Qt Online Installer - openssl 3.0+
- googletest (optional)
If your disto has dev or devel package be sure to install those.
- libei 1.3
- libportal 0.8
- qt 6.7+
- google test (optional)
Debian/Ubuntu:
apt install cmake build-essential ninja-build \
xorg-dev libx11-dev libxtst-dev libssl-dev \
libglib2.0-dev libxkbfile-dev qt6-base-dev qt6-tools-dev \
libgtk-3-dev libgtest-dev libgmock-dev libei-dev libportal-dev
Fedora:
dnf install cmake make ninja-build gcc-c++ rpm-build \
openssl-devel glib2-devel libXtst-devel libxkbfile-devel \
qt6-qtbase-devel qt6-qttools-devel gtk3-devel \
gtest-devel gmock-devel libei-devel libportal-devel
RHEL
dnf install epel-release
dnf config-manager --set-enabled crb
dnf install cmake make ninja-build gcc-c++ rpm-build \
openssl-devel glib2-devel libXtst-devel libxkbfile-devel \
qt6-qtbase-devel qt6-qttools-devel gtk3-devel \
gtest-devel gmock-devel libei-devel libportal-devel
SUSE/openSUSE:
zypper install cmake make ninja gcc-c++ rpm-build libopenssl-devel \
glib2-devel libXtst-devel libxkbfile-devel qt6-base-devel \
qt6-tools-devel qt6-linguist-devel gtk3-devel googletest-devel \
googlemock-devel libei-devel libportal-devel
Arch Linux:
pacman -S base-devel cmake ninja gcc openssl \
glib2 libxtst libxkbfile gtest libei libportal \
qt6-base qt6-tools qt6-translations qt6-declarative gtk3
FreeBSD:
pkg install cmake ninja gmake gcc12 openssl glib \
libX11 libXtst libxkbfile qt6-base qt6-tools \
gtk3 googletest pkgconf libei libportal
CMake options:
| Option | Description | Default Value | Additional requirements |
|---|---|---|---|
| BUILD_USER_DOCS | Build User Documentation | DOXYGEN_FOUND | Doxygen |
| BUILD_DEV_DOCS | Build developer Documentation | OFF | Doxygen |
| BUILD_INSTALLER | Build installers/packages | ON | |
| BUILD_TESTS | Build unit tests and legacy tests | ON | gtest |
| BUILD_X11_SUPPORT | Build X11 backend (linux and bsd only | ON | x11 , xlibs |
| ENABLE_COVERAGE | Enable test coverage | OFF | gcov |
| SKIP_BUILD_TESTS | Skip running of tests at build time | OFF | |
| VCPKG_QT | Build Qt w/ vcpkg (windows only) | OFF | |
| CLEAN_TRS | Remove obsolete strings from tr files | OFF | |
| APPLE_CODESIGN_DEV | Apple codesign certID for development | Not Set |
To configure you use CMake.
Tip
You could create a CMakeUserPresets.json file.
Configure command example:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
Build command example:
cmake --build build -j8
Attempted fix: https://github.com/deskflow/deskflow/pull/8057
Create a qt.conf file in bin:
[Paths]
Plugins = C:\vcpkg...debug\Qt6\plugins
Icons must be installed to work correctly on linux
copy deploy/linux/org.deskflow.deskflow.png -> /usr/share/icons/hicolor/512x512/apps/org.deskflow.deskflow.png
copy src/apps/res/icons/deskflow-light/apps/64/org.deskflow.deskflow-symbolic.svg -> /usr/share/icons/hicolor/symbolic/apps/org.deskflow.deskflow-symbolic.svg
you may need to update your icon cache with a command like gtk-update-icon-cache after copying them over
Important
Requires PR #9089
- Install Xcode
- Go to Settings -> Accounts
- Add your account (requires a free Apple Developer ID)
- Manage certificates -> Add -> Apple Development
- To get your ID, run:
security find-identity -v -p codesigning login.keychain-db - Pass the ID to CMake, e.g.
-DAPPLE_CODESIGN_DEV=Apple Development: [email protected] (KLGSJHLFXY).can be used as the id if you have only one setup - Configure and build
- To verify, run:
codesign -d -r- build/bin/Deskflow.app