CMake setting reference¶
This section references all settings that can be used with Cahute’s CMake settings.
CMake built-in settings¶
The following variables can be used with every CMake project, and described amongst others in cmake-variables(7), but may be described with information more relevant to Cahute here.
CMAKE_BUILD_TYPEBuild type. Commonly found values with Cahute are the following:
DebugNon-optimized output with debug symbols and no binary stripping.
ReleaseOptimized output.
Note
As described in the CMake package guidelines for Archlinux, CMake automatically forces
-O3whenReleaseis selected. Cahute overrides this with-O2instead.CMAKE_INSTALL_PREFIXInstall prefix.
In the build from source guides, it is recommended to set this to
/usrrather than the default/usr/localvalue.CMAKE_VERBOSE_MAKEFILEOptional switch to set to
ONto see the commands executed when building the project.
Cahute-specific general settings¶
The following variables are specific to Cahute.
CAHUTE_APPSTREAMInclude AppStream declarations.
This is disabled by default.
CAHUTE_CLIEnable command-line utilities.
This is enabled by default.
CAHUTE_CLI_EXPERIMENTALEnable experimental / unfinished command-line utilities.
This is disabled by default.
CAHUTE_CLI_LIBRARY_TYPEWhich type of the Cahute library should the CLI utilities, if built, depend on.
This can be set to the following values:
auto(by default)The most suitable library type is chosen:
If CAHUTE_SHARED is enabled, the shared library is used;
Otherwise, if CAHUTE_CLI_PIE is enabled, the static library with position-independent code is used, which means CAHUTE_STATIC_PIC must be enabled;
Otherwise, the static library with position-dependent code is used, which means CAHUTE_STATIC must be enabled.
sharedThe shared library is used, which means CAHUTE_SHARED must be enabled.
staticThe most suitable static library is chosen:
If CAHUTE_CLI_PIE is enabled, the static library with position-independent code is used, which means CAHUTE_STATIC_PIC must be enabled;
Otherwise, the static library with position-dependent code is used, which means CAHUTE_STATIC must be enabled.
CAHUTE_CLI_PIEEnable building CLI utilities as position-independent executables (PIE).
By default, this is enabled on Linux distributions and Win32, and disabled on all others.
CAHUTE_CLI_RUNTIME_DEPSWhether to install runtime dependencies (such as shared libraries) with the command-line utilities.
This is disabled by default on all platforms.
CAHUTE_DEFAULT_LOGLEVELDefault logging level used when creating a context, among
debuginfo,warning(by default),error,fatalandnone.See Logging facilities for more information.
CAHUTE_GITInclude git-related information to the built targets, i.e. if the source directory is a git repository with at least one commit on the current branch, the following macros will be defined and included in the headers:
CAHUTE_GIT_COMMIT;CAHUTE_GIT_BRANCH;CAHUTE_GIT_TAGGED;CAHUTE_GIT_DIRTY.
This is enabled by default.
CAHUTE_INSTALL_UDEVDIRPath to the directory in which the udev configuration is assumed to be stored.
If CAHUTE_UDEV is
ON, the udev rules will be installed into${CAHUTE_INSTALL_UDEVDIR}/rules.d.By default, this is set to
${CMAKE_INSTALL_LIBDIR}/udev, e.g./usr/lib/udevon Linux.
CAHUTE_LIBUSBEnable the use of libusb.
Note
This will be ignored on Win32, since Cahute needs to support drivers libusb doesn’t.
This is enabled by default on platforms libusb support.
CAHUTE_PKGCONFEnable installing pkgconf / pkg-config files.
This is supported by default.
CAHUTE_REPORT_URLURL to the bug reporting guide included within the library and command-line utilities.
CAHUTE_SDLEnable the use of SDL.
This is enabled by default on platforms SDL2 support.
CAHUTE_STATICEnable building the library as a static library (
.a,.lib), with position-dependent code.By default, this is enabled on all platforms.
CAHUTE_STATIC_PICEnable building the library as a static library (
.a,.lib), with position-independent code.By default, this is disabled on all platforms.
CAHUTE_UDEVEnable building and installing the udev rules.
This is enabled by default when building for Linux.
CAHUTE_UDEV_GROUPName of the group to which the udev rule gives permission to calculators plugged in via USB.
This is set to
uucpby default.Note
It is recommended to set the same system group here as for other serial devices, as defined by your distribution.
The Linux Standard Base groups defines
uucpand the Archlinux user groups use it for serial devices, other distributions use other groups such asdialout. See the following for more information:Warning
Since systemd v258 (released on September 17th, 2025), udev no longer allows user groups to be used in udev rules:
systemd-udevd ignores
OWNER=/GROUP=settings with a non-system user/group specified in udev rules files, to avoid device nodes being owned by a non-system user/group. It is recommended to check udev rules files withudevadm verifyand/orudevadm testcommands if the specified user/group inOWNER=/GROUP=are valid.If building and installing the udev rules is enabled (i.e. CAHUTE_UDEV is set to
ON), this must be set to the name of a system group on the destination system.This policy is enforced in at least the following distributions:
Debian Forky (14) and above, unreleased as of writing (planned for 2027);
Ubuntu Resolute Raccoon (26.04) and above, since April 2026;
Arch Linux and up-to-date derivatives, since September 2025.
Cahute-specific command-line utility switches¶
Most command-line utilities in Cahute can be enabled using the CAHUTE_CLI setting.
However, they can also be individually enabled using the following switches:
Cahute-specific experimental command-line utility switches¶
Some command-line utilities in Cahute are considered experimental (not fully implemented), and can be enabled by enabling both the CAHUTE_CLI and CAHUTE_CLI_EXPERIMENTAL settings.
However, they can also be individually enabled using the following switches:
CAHUTE_CLI_CASEnable building CaS.