Skip to content

CMake Options

Tasos Sahanidis edited this page Mar 18, 2018 · 8 revisions

This article is a stub. Don't edit it unless you know what you are doing. Don't follow it unless you know what you are doing.

To pass any option to CMake use -DOPTION=VALUE syntax. For example:

cmake -DFOO=ON -DSURNAME="DOE" -DBAR=OFF ..

turns on FOO, sets SURNAME to DOE string and turns off BAR.

Below is the list of all available options with their description. The syntax of the list is OPTION:TYPE=DEFAULT_VALUE, where TYPE is either BOOL (boolean, can be either ON or OFF) or STRING. For example, WITH_MVIZ:BOOL=ON means that WITH_MVIZ is a boolean that is enabled by default and the equivalent of:

cmake -DWITH_MVIZ=ON ..

NOTE: if you want to configure multiple options, you must do so in one call to cmake, as shown in the very first example.

NOTE: you can also configure the project in a GUI using cmake-gui and in a TUI using ccmake (if they are installed).

NOTE: all variables here, unless otherwise stated, are created by ckb-next. For a full list of all CMake variables and properties see CMake documentation.

Linux-only options

WITH_MVIZ:BOOL=ON

Build with music visualizer. By default becomes OFF if WITH_ANIMATIONS is OFF.

INSTALL_DIR_ANIMATIONS:STRING="${CMAKE_INSTALL_LIBEXECDIR}/ckb-next-animations"

Where to install animations. ${CMAKE_INSTALL_LIBEXECDIR} means the value of CMAKE_INSTALL_LIBEXECDIR option, which is libexec according to GNU Coding Standards. Different for macOS.

macOS-only options

USE_BREW_QT5:BOOL=ON

Use Qt5 package provided by Homebrew package manager. If you turn this option off, you have to pass the location of Qt5 installation root inside CMAKE_PREFIX_PATH. For example:

cmake -DCMAKE_PREFIX_PATH="/foo/bar/qt5" ..

USE_BREW_QUAZIP:BOOL=ON

Use QuaZip package provided by Homebrew package manager. If you turn this option off, you have to pass the location of QuaZip installation root inside CMAKE_PREFIX_PATH. If USE_BREW_QT5 is OFF too, you have to pass both paths as in a ;-list. For example:

cmake -DCMAKE_PREFIX_PATH="/path/to/quazip;/path/to/qt5" ..

INSTALL_DIR_ANIMATIONS:STRING="ckb-next.app/Resources/ckb-next-animations"

Where to install animations. Different for Linux.

Cross-platform options

CMAKE_BUILD_TYPE:STRING="RelWithDebInfo"

Specify the build type on single-configuration generators. Possible values are empty, Debug, Release, RelWithDebInfo and MinSizeRel. For end-user builds it is recommended to use Release, for developers - Debug.

WITH_GUI:BOOL=ON

Build with Qt GUI to manipulate animations and a lot more. ckb-next daemon and GUI are more or less separate, but it is not recommended to turn it off unless all you want is just a device driver and static highlighting profile.

WITH_ANIMATIONS:BOOL=ON

Build with animations. This is a generic option that has to be enabled as a prepequisite for animations in general, but doesn't control what animations to build in particular.

WITH_GRADIENT:BOOL=ON

Build with 'Gradient' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_HEAT:BOOL=ON

Build with 'Heat Map' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_RAIN:BOOL=ON

Build with 'Rain' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_RANDOM:BOOL=ON

Build with 'Random' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_PINWHEEL:BOOL=ON

Build with 'Pinwheel' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_RIPPLE:BOOL=ON

Build with 'Ripple' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

WITH_WAVE:BOOL=ON

Build with 'Wave' animation. Requires WITH_ANIMATIONS and WITH_GUI to be ON. If any of those is OFF, this option is implicitly OFF by default.

SAFE_INSTALL:BOOL=OFF

Execute pre-install tasks to ensure correct installation, such as: close the GUI, stop and disable the daemon depending on an init system. Intended to be used with direct installations without package manager.

NOTE: privileged access is required for operations upon the daemon at configure time as it is owned by root. If this is unacceptable, disable SAFE_INSTALL and prepare the filesystem manually.

WITH_SHIPPED_QUAZIP:BOOL=OFF

Force use of shipped QuaZip5 instead of system package. Enable only if there is an issue with the system library. It is advised to always use a system package.

DEBUG_USB_SEND:BOOL=OFF

Show the contents of USB packets being sent to device. Intended for ckb-next developers.

DEBUG_USB_RECV:BOOL=OFF

Show the contents of USB packets being received from device through os_usbrecv(). Intended for ckb-next developers.

DEBUG_USB_INPUT:BOOL=OFF

Show the contents of USB packets being received from device through the input thread. Intended for ckb-next developers.

WITH_SANITIZERS:BOOL=OFF

Enable certain sanitizers for certain targets. By default SANITIZE_ADDRESS and SANITIZE_UNDEFINED will be enabled when this option is enabled. Intended for ckb-next developers.

SANITIZE_ADDRESS:BOOL=ON

Enable AddressSanitizer. Requires WITH_SANITIZERS to be ON. If WITH_SANITIZERS is OFF, this option is OFF by default. Intended for ckb-next developers.

SANITIZE_UNDEFINED:BOOL=ON

Enable UndefinedBehaviorSanitizer. Requires WITH_SANITIZERS to be ON. If WITH_SANITIZERS is OFF, this option is OFF by default. Intended for ckb-next developers.

SANITIZE_MEMORY:BOOL=OFF

Enable MemorySanitizer. Requires WITH_SANITIZERS to be ON, however, even if WITH_SANITIZERS is ON it stays OFF by default. Intended for ckb-next developers.

SANITIZE_THREAD:BOOL=OFF

Enable ThreadSanitizer. Requires WITH_SANITIZERS to be ON, however, even if WITH_SANITIZERS is ON it stays OFF by default. Intended for ckb-next developers.

SANITIZE_THREAD:BOOL=OFF

Try linking static against sanitizers. Requires WITH_SANITIZERS to be ON, however, even if WITH_SANITIZERS is ON it stays OFF by default. Intended for ckb-next developers.