Changes various CMake settings to what the KDE community views as more sensible defaults.

It is recommended to include this module with the NO_POLICY_SCOPE flag, otherwise you may get spurious warnings with some versions of CMake.

It is split into three parts, which can be independently disabled if desired.

Runtime Paths

The default runtime path (used on Unix systems to search for dynamically-linked libraries) is set to include the location that libraries will be installed to (as set in LIB_INSTALL_DIR or, if the former is not set, KDE_INSTALL_LIBDIR), and also the linker search path.

Note that LIB_INSTALL_DIR or alternatively KDE_INSTALL_LIBDIR needs to be set before including this module. Typically, this is done by including the KDEInstallDirs module.

This section can be disabled by setting KDE_SKIP_RPATH_SETTINGS to TRUE before including this module.


Testing is enabled by default, and an option (BUILD_TESTING) is provided for users to control this. See the CTest module documentation in the CMake manual for more details.

This section can be disabled by setting KDE_SKIP_TEST_SETTINGS to TRUE before including this module.

Build Settings

Various CMake build defaults are altered, such as searching source and build directories for includes first, enabling automoc by default.

When find_package(ECM 5.38) or higher is called, this also selects a layout for the build dir that helps running executables without installing.

This section can be disabled by setting KDE_SKIP_BUILD_SETTINGS to TRUE before including this module.

This section also provides an “uninstall” target that can be individually disabled by setting KDE_SKIP_UNINSTALL_TARGET to TRUE before including this module.

By default on OS X, X11 and XCB related detections are disabled. However if the need would arise to use these technologies, the detection can be enabled by setting APPLE_FORCE_X11 to ON.

A warning is printed for the developer to know that the detection is disabled on OS X. This message can be turned off by setting APPLE_SUPPRESS_X11_WARNING to ON.

Since pre-1.0.0.

ENABLE_CLAZY option is added (OFF by default) when clang is being used. Turning this option on will force clang to load the clazy plugins for richer warnings on Qt-related code.

If clang is not being used, this won’t have an effect. See https://commits.kde.org/clazy?path=README.md

Since 5.17.0

  • Uninstall target functionality since 1.7.0.
  • APPLE_FORCE_X11 option since 5.14.0 (detecting X11 was previously the default behavior)
  • APPLE_SUPPRESS_X11_WARNING option since 5.14.0


A fetch-translations target will be set up that will download translations for projects using l10n.kde.org.

KDE_L10N_BRANCH will be responsible for choosing which l10n branch to use for the translations.

KDE_L10N_AUTO_TRANSLATIONS (OFF by default) will indicate whether translations should be downloaded when building the project.

Since 5.34.0