home
features
downloads
support
news
about
PreviewQt
PhotoQt v4.4

Building PhotoQt from source

The instructions below serve as a guide to compile and install PhotoQt from source. PhotoQt is available in the repositories of an increasing number of Linux distributions. In addition, various means of installing PhotoQt (Windows installer, Flatpak, etc.) are listed on the Downloads page.

If you are looking for help with building PhotoQt on Windows you can find some more detailed instructions further down.

Dependencies

Make sure that you have all the required QML modules installed:
QtGraphicalEffects, QtMultimedia, QtQuick, QtQuick.Controls, QtQuick.Controls.Styles, QtQuick.Layouts, QtQuick.Window, QtLocation, QtPositioning, QtCharts.

Dependencies that are needed by default, but can be disabled via CMake:

Dependencies that are disabled by default, but can be enabled via CMake:

Please note that you probably want to have as many of these enabled as possible as they greatly enhance the experience of PhotoQt.

NOTE

On some systems you also need the *-dev package for compiling (e.g. exiv2-dev - names can vary slightly depending on your distribution). These packages usually can be uninstalled again after compilation is done.

NOTE

PhotoQt can work with either ImageMagick and GraphicsMagick, but due to conflicting naming schemes it is not possible to use both at the same time. By default ImageMagick will be enabled in CMake.

NOTE

Exiv2 can be compiled with support for the BMFF format. Note that there is the possibility that BMFF support may be the subject of patent rights. PhotoQt will by default opt-in to reading this format (if supported by Exiv2). If you prefer to not include support for this format in PhotoQt simply set the EXIV2_ENABLE_BMFF CMake option to OFF.

Additional image formats

These are some libraries and tools that can add additional formats to PhotoQt if installed. None of them are needed at compile time, but they can be picked up at runtime if available.


Building on Linux

  1. mkdir build && cd build/
  2. cmake ..

    # Note: This installs PhotoQt by default into /usr/local/{bin,share}
    # To install PhotoQt into another prefix e.g. /usr/{bin,share}, run:
    cmake -DCMAKE_INSTALL_PREFIX=/usr ..

    # At this step you can also en-/disable any compile time features.

  3. make

    # This creates an executeable photoqt binary located in the ./build/ folder

  4. (as root or sudo) make install

    # This command:
    # 1. is only required if you want to **install** PhotoQt
    # 2. installs the desktop file to share/applications/
    # 3. moves some icons to icons/hicolor/
    # 4. moves the binary to bin/
    # 5. installs the metainfo file to share/metainfo/

Uninstall

If you want to uninstall PhotoQt, simply run **make uninstall** as root. This removes the desktop file (via xdg-desktop-menu uninstall), the icons, the binary file, and the metainfo file. Alternatively you can simply remove all the files manually which should yield the same result.


Building on Windows

You can find an installer for pre-built binaries in the Windows section of the Downloads page.

If you prefer to build it yourself, this process is not as hard as it might seem at first. The main challenge in building PhotoQt on Windows lies in getting the environment set up and all dependencies installed.

The following are required dependencies:

  1. Install Visual Studio 2019 Community Edition (free, be sure to install the 'Desktop Development with C++' workload)

  2. Install CMake

  3. Install at least Qt 6.2 (6.5+ recommended)

The following dependencies are recommended but can be disabled through CMake if not wanted:

Make sure that any installed dependency is added to the system path, or otherwise you need to explicitely point CMake to the right location for each of them. Regardless, CMake might have to be explicitely pointed to the library/include paths of some of the dependencies by specifying target_include_directories() and target_link_libraries().

Once all the requried and desired dependencies are installed, then the source code of PhotoQt can be fetched from the Downloads page. PhotoQt can now be built in any way you are comfortable with, for example through the command line, through the Visual Studio IDE, or through the Qt Creator IDE.

Note that all required DLLs need to be moved to right (sub-)directories where the resulting executable can find them.