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.
This module finds KDE 3 include directories, libraries, and KDE-specific preprocessor tools. It provides usage requirements for building KDE 3 software and defines several helper commands to simplify working with KDE 3 in CMake.
This module defines the following variables:
KDE3_FOUNDBoolean indicating whether KDE 3 is found.
KDE3_DEFINITIONSCompiler definitions required for compiling KDE 3 software.
KDE3_INCLUDE_DIRSThe KDE and the Qt include directories, for use with the
target_include_directories() command.
KDE3_LIB_DIRThe directory containing the installed KDE 3 libraries, for use with the
target_link_directories() command.
QT_AND_KDECORE_LIBSA list containing both the Qt and the kdecore library, typically used together when linking KDE 3.
The following cache variables may also be set:
KDE3_INCLUDE_DIRThe directory containing KDE 3 header files.
KDE3_DCOPIDL_EXECUTABLEThe path to the dcopidl executable.
KDE3_DCOPIDL2CPP_EXECUTABLEThe path to the dcopidl2cpp executable.
KDE3_KCFGC_EXECUTABLEThe path to the kconfig_compiler executable.
This module accepts the following variables:
KDE3_BUILD_TESTSProvided as a user adjustable option. Set this variable to boolean true to build KDE 3 testcases.
This module provides the following commands to work with KDE 3 in CMake:
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.
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.
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.
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.
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.
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.
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>.
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.
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.
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.
Finding KDE 3:
find_package(KDE3)