FindKDE3 — CMake 4.3.3 Documentation

# FindKDE3

Note

This module is specifically intended for KDE version 3, which is obsolete and no longer maintained. For modern application development using KDE technologies with CMake, use a newer version of KDE, and refer to the KDE documentation.

Finds KDE 3 include directories, libraries, and KDE-specific preprocessor tools:

    find_package(KDE3 [...])

This module provides usage requirements for building KDE 3 software and defines several helper commands to simplify working with KDE 3 in CMake.

## Result Variables

This module defines the following variables:

`KDE3_FOUND`

  Boolean indicating whether KDE 3 was found.

`KDE3_DEFINITIONS`

  Compiler definitions required for compiling KDE 3 software.

`KDE3_INCLUDE_DIRS`

  The KDE and the Qt include directories, for use with the `target_include_directories()` command.

`KDE3_LIB_DIR`

  The directory containing the installed KDE 3 libraries, for use with the `target_link_directories()` command.

`QT_AND_KDECORE_LIBS`

  A list containing both the Qt and the kdecore library, typically used together when linking KDE 3.

## Cache Variables

The following cache variables may also be set:

`KDE3_INCLUDE_DIR`

  The directory containing KDE 3 header files.

`KDE3_DCOPIDL_EXECUTABLE`

  The path to the `dcopidl` executable.

`KDE3_DCOPIDL2CPP_EXECUTABLE`

  The path to the `dcopidl2cpp` executable.

`KDE3_KCFGC_EXECUTABLE`

  The path to the `kconfig_compiler` executable.

## Hints

This module accepts the following variables:

`KDE3_BUILD_TESTS`

  Provided as a user adjustable option. Set this variable to boolean true to build KDE 3 testcases.

## Commands

This module provides the following commands to work with KDE 3 in CMake:

kde3_automoc

  Enables automatic processing with `moc` for the given source files:

      kde3_automoc(<sources>...)

  Call this command to enable automatic `moc` file handling. For example, if a source file (e.g., `foo.cpp`) contains `include "foo.moc"`, a `moc` file for the corresponding header (`foo.h`) will be generated automatically. To skip processing for a specific source file, set the `SKIP_AUTOMOC` source file property.

kde3_add_moc_files

  Processes header files with `moc`:

      kde3_add_moc_files(<variable> <headers>...)

  If not using `kde3_automoc()`, this command can be used to generate `moc` files for one or more `<headers>` files. The generated files are named `<filename>.moc.cpp` and the resulting list of these generated source files is stored in the variable named `<variable>` for use in project targets.

kde3_add_dcop_skels

  Generates KIDL and DCOP skeletons:

      kde3_add_dcop_skels(<variable> <dcop-headers>...)

  This command generates `.kidl` and DCOP skeleton source files from the given DCOP header files. The resulting list of generated source files is stored in the variable named `<variable>` for use in project targets.

kde3_add_dcop_stubs

  Generates DCOP stubs:

      kde3_add_dcop_stubs(<variable> <headers>...)

  Use this command to generate DCOP stubs from one or more given header files. The resulting list of generated source files is stored in the variable named `<variable>` for use in project targets.

kde3_add_ui_files

  Adds Qt designer UI files:

      kde3_add_ui_files(<variable> <ui-files>...)

  This command creates the implementation files from the given Qt designer `.ui` files. The resulting list of generated files is stored in the variable named `<variable>` for use in project targets.

kde3_add_kcfg_files

  Adds KDE kconfig compiler files:

      kde3_add_kcfg_files(<variable> <kcfgc-files>...)

  Use this command to add KDE kconfig compiler files (`.kcfgc`) to the application/library. The resulting list of generated source files is stored in the variable named `<variable>` for use in project targets.

kde3_install_libtool_file

  Creates and installs a libtool file:

      kde3_install_libtool_file(<target>)

  This command creates and installs a basic libtool file for the given target `<target>`.

kde3_add_executable

  Adds KDE executable:

      kde3_add_executable(<name> <sources>...)

  This command is functionally identical to the built-in `add_executable()` command. It was originally intended to support additional features in future versions of this module.

kde3_add_kpart

  Creates a KDE plugin:

      kde3_add_kpart(<name> [WITH_PREFIX] <sources>...)

  This command creates a KDE plugin (KPart, kioslave, etc.) from one or more source files `<sources>`. It also creates and installs an appropriate libtool `.la` file.

  If the `WITH_PREFIX` option is given, the resulting plugin name will be prefixed with `lib`. Otherwise, no prefix is added.

kde3_add_kdeinit_executable

  Creates a KDE application as a module loadable via kdeinit:

      kde3_add_kdeinit_executable(<name> <sources>...)

  This command creates a library named `kdeinit_<name>` from one or more source files `<sources>`. It also builds a small executable linked against this library.

## Examples

Finding KDE 3:

    find_package(KDE3)