Skip to content
Adrien Bertrand edited this page Oct 8, 2024 · 12 revisions

First, download the full source: git clone --recursive https://github.com/CE-Programming/CEmu.git.
You can also get the zip (but don't forget to download the submodules too).

With version 2.0, we have added full CMake compatibility to the build system (qmake is still supported), for both Qt5 and Qt6. This greatly simplifies building, and even more so if you have vcpkg installed as all the dependencies are taken care of internally.

Building with CMake+vcpkg integration (preferred)

This allows you not to have any dependencies installed already, as it will take care of everything.
You will likely want to use the CMake option -DDEPS_RELEASE_ONLY=ON to minimize deps building.
Note that you should use a preset (we provide a few) that fits your setup and desired option.
Using an IDE that supports this (Visual Studio, Clion...) makes it even simpler.

Example for a Qt6 CEmu release build for arm macOS (using ninja as the generator is preferred, but not required):

# Step 0, be where you need to be
cd CEmu/gui/qt

# Step 1, configure
cmake -G Ninja --preset Mac-arm64-Qt6 -DDEPS_RELEASE_ONLY=ON

# Step 2, build (it will be in the CEmu.build folder)
cmake --build --preset Mac-arm64-Qt6-Release

Note: the initial build (more specifically the first cmake configuration) will take some time for the deps to be ready, but that's expected.

Building with CMake (without vcpkg)

If you already have the dependencies installed/available on your system, you can just use CMake as usual to build CEmu.

pkg-config is required. The Ninja generator is preferred.

More "manual" build (old way)

Building libpng-apng

CEmu uses Animated PNGs ("APNG") to record the screen efficiently. This requires an appropriate libpng version on your system, you must first follow the guide on this page in order to properly build the library for your system.

Building CEmu itself

  1. Get the latest Qt SDK for your OS (Qt 5 and 6 (preferred) are supported).

  2. Now you have two options to actually build CEmu:

  • In a shell, cd to the project's /gui/qt/ folder and type qmake -r CEmu.pro && make
  • Open the .pro file with Qt Creator, set it up (default project settings should be fine), and hit Build.

(Note that you can also use CMake if you want - check the CI for an example)

Build issues and solutions

  • If you're on macOS or Linux, you may need to force update your PATH to have Qt's bin/ folder prepended (i.e. edit your shell's profile (for example ~/.bashrc), and add the line: export PATH=<path to Qt directory>/bin:$PATH
    You may need to run this command under Linux as well: sudo apt-get install git qt5-default

  • If you're on macOS or Linux, and use Qt Creator, you may need to launch it from the terminal to avoid potential pkg-config issues (for instance, not correctly finding libpng).

  • If you're on macOS, CEmu might not launch from Qt Creator, with the default settings. You should then untick some checkboxes in the project's settings.

  • If you're on macOS, some dependencies like libarchive may not be available through pkg-config directly.
    To solve this, do what brew recommends, i.e. append/prepend its path directly to the env var:
    export PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig:$PKG_CONFIG_PATH" in your .bash_profile / .zshrc.
    When doing such modifications, you'll then have to launch Qt Creator from your terminal (just open path_to_.app).

  • If you encounter a build error with something like lto-wrapper failed, try removing the -flto option in the .pro file and rebuild (qmake etc.).

  • If you have the required packages but still have qmake complain, make sure you have pkg-config installed.

Extra information

If you are using linux, use sudo make install (or equivalent) to integrate with your desktop.