Warning, /frameworks/kdelibs4support/cmake/modules/FindKDE4Internal.cmake is written in an unsupported language. File is not indexed.

0001 # - Find the KDE4 include and library dirs, KDE preprocessors and define a some macros
0002 #
0003 # This module defines the following variables:
0004 #
0005 #  KDE4_FOUND               - set to TRUE if everything required for building KDE software has been found
0006 #
0007 #  KDE4_DEFINITIONS         - compiler definitions required for compiling KDE software
0008 #  KDE4_INCLUDE_DIR         - the KDE 4 include directory
0009 #  KDE4_INCLUDES            - all include directories required for KDE, i.e.
0010 #                             KDE4_INCLUDE_DIR, but also the Qt4 include directories
0011 #                             and other platform specific include directories
0012 #  KDE4_LIB_DIR             - the directory where the KDE libraries are installed,
0013 #                             intended to be used with LINK_DIRECTORIES(). In general, this is not necessary.
0014 #  KDE4_LIBEXEC_INSTALL_DIR - the directory where libexec executables from kdelibs are installed
0015 #  KDE4_BIN_INSTALL_DIR     - the directory where executables from kdelibs are installed
0016 #  KDE4_SBIN_INSTALL_DIR    - the directory where system executables from kdelibs are installed
0017 #  KDE4_DATA_INSTALL_DIR    - the parent directory where kdelibs applications install their data
0018 #  KDE4_HTML_INSTALL_DIR    - the directory where HTML documentation from kdelibs is installed
0019 #  KDE4_CONFIG_INSTALL_DIR  - the directory where config files from kdelibs are installed
0020 #  KDE4_ICON_INSTALL_DIR    - the directory where icons from kdelibs are
0021 #  KDE4_IMPORTS_INSTALL_DIR - the directory where imports from kdelibs are
0022 #  KDE4_KCFG_INSTALL_DIR    - the directory where kconfig files from kdelibs are installed
0023 #  KDE4_LOCALE_INSTALL_DIR  - the directory where translations from kdelibs are installed
0024 #  KDE4_MIME_INSTALL_DIR    - the directory where mimetype desktop files from kdelibs are installed
0025 #  KDE4_SOUND_INSTALL_DIR   - the directory where sound files from kdelibs are installed
0026 #  KDE4_TEMPLATES_INSTALL_DIR     - the directory where templates (Create new file...) from kdelibs are installed
0027 #  KDE4_WALLPAPER_INSTALL_DIR     - the directory where wallpapers from kdelibs are installed
0028 #  KDE4_KCONF_UPDATE_INSTALL_DIR  - the directory where kconf_update files from kdelibs are installed
0029 #  KDE4_AUTOSTART_INSTALL_DIR     - the directory where autostart from kdelibs are installed
0030 #  KDE4_XDG_APPS_INSTALL_DIR      - the XDG apps dir from kdelibs
0031 #  KDE4_XDG_DIRECTORY_INSTALL_DIR - the XDG directory from kdelibs
0032 #  KDE4_SYSCONF_INSTALL_DIR       - the directory where sysconfig files from kdelibs are installed
0033 #  KDE4_MAN_INSTALL_DIR           - the directory where man pages from kdelibs are installed
0034 #  KDE4_INFO_INSTALL_DIR          - the directory where info files from kdelibs are installed
0035 #  KDE4_DBUS_INTERFACES_DIR       - the directory where dbus interfaces from kdelibs are installed
0036 #  KDE4_DBUS_SERVICES_DIR         - the directory where dbus service files from kdelibs are installed
0037 #
0038 # The following variables are defined for the various tools required to
0039 # compile KDE software:
0040 #
0041 #  KDE4_KCFGC_EXECUTABLE    - the kconfig_compiler_kf5 executable
0042 #  KDE4_MAKEKDEWIDGETS_EXECUTABLE - the makekdewidgets executable
0043 #
0044 # The following variables point to the location of the KDE libraries,
0045 # but shouldn't be used directly:
0046 #
0047 #  KDE4_KDECORE_LIBRARY     - the kdecore library
0048 #  KDE4_KDEUI_LIBRARY       - the kdeui library
0049 #  KDE4_KIO_LIBRARY         - the kio library
0050 #  KDE4_KPARTS_LIBRARY      - the kparts library
0051 #  KDE4_KUTILS_LIBRARY      - the kutils library
0052 #  KDE4_KEMOTICONS_LIBRARY  - the kemoticons library
0053 #  KDE4_KIDLETIME_LIBRARY   - the kidletime library
0054 #  KDE4_KCMUTILS_LIBRARY    - the kcmutils library
0055 #  KDE4_KPRINTUTILS_LIBRARY - the kprintutils library
0056 #  KDE4_KHTML_LIBRARY       - the khtml library
0057 #  KDE4_KJS_LIBRARY         - the kjs library
0058 #  KDE4_KJSAPI_LIBRARY      - the kjs public api library
0059 #  KDE4_KNEWSTUFF2_LIBRARY  - the knewstuff2 library
0060 #  KDE4_KNEWSTUFF3_LIBRARY  - the knewstuff3 library
0061 #  KDE4_KDNSSD_LIBRARY      - the kdnssd library
0062 #  KDE4_THREADWEAVER_LIBRARY- the threadweaver library
0063 #  KDE4_SOLID_LIBRARY       - the solid library
0064 #  KDE4_KNOTIFYCONFIG_LIBRARY- the knotifyconfig library
0065 #  KDE4_KROSSCORE_LIBRARY   - the krosscore library
0066 #  KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library
0067 #  KDE4_NEPOMUK_LIBRARY     - the nepomuk library
0068 #  KDE4_PLASMA_LIBRARY      - the plasma library
0069 #  KDE4_KUNITCONVERSION_LIBRARY - the kunitconversion library
0070 #  KDE4_KDEWEBKIT_LIBRARY   - the kdewebkit library
0071 #
0072 #  KDE4_PLASMA_OPENGL_FOUND  - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise
0073 #
0074 # Compared to the variables above, the following variables
0075 # also contain all of the depending libraries, so the variables below
0076 # should be used instead of the ones above:
0077 #
0078 #  KDE4_KDECORE_LIBS          - the kdecore library and all depending libraries
0079 #  KDE4_KDEUI_LIBS            - the kdeui library and all depending libraries
0080 #  KDE4_KIO_LIBS              - the kio library and all depending libraries
0081 #  KDE4_KPARTS_LIBS           - the kparts library and all depending libraries
0082 #  KDE4_KUTILS_LIBS           - the kutils library and all depending libraries
0083 #  KDE4_KEMOTICONS_LIBS       - the kemoticons library and all depending libraries
0084 #  KDE4_KIDLETIME_LIBS        - the kidletime library and all depending libraries
0085 #  KDE4_KCMUTILS_LIBS         - the kcmutils library and all depending libraries
0086 #  KDE4_KPRINTUTILS_LIBS      - the kprintutils library and all depending libraries
0087 #  KDE4_KHTML_LIBS            - the khtml library and all depending libraries
0088 #  KDE4_KJS_LIBS              - the kjs library and all depending libraries
0089 #  KDE4_KJSAPI_LIBS           - the kjs public api library and all depending libraries
0090 #  KDE4_KNEWSTUFF2_LIBS       - the knewstuff2 library and all depending libraries
0091 #  KDE4_KNEWSTUFF3_LIBS       - the knewstuff3 library and all depending libraries
0092 #  KDE4_KDNSSD_LIBS           - the kdnssd library and all depending libraries
0093 #  KDE4_KDESU_LIBS            - the kdesu library and all depending libraries
0094 #  KDE4_KPTY_LIBS             - the kpty library and all depending libraries
0095 #  KDE4_THREADWEAVER_LIBRARIES- the threadweaver library and all depending libraries
0096 #  KDE4_SOLID_LIBS            - the solid library and all depending libraries
0097 #  KDE4_KNOTIFYCONFIG_LIBS    - the knotify config library and all depending libraries
0098 #  KDE4_KROSSCORE_LIBS        - the kross core library and all depending libraries
0099 #  KDE4_KROSSUI_LIBS          - the kross ui library which includes core and all depending libraries
0100 #  KDE4_KTEXTEDITOR_LIBS      - the ktexteditor library and all depending libraries
0101 #  KDE4_NEPOMUK_LIBS          - the nepomuk library and all depending libraries
0102 #  KDE4_PLASMA_LIBS           - the plasma library and all depending librairies
0103 #  KDE4_KUNITCONVERSION_LIBS  - the kunitconversion library and all depending libraries
0104 #  KDE4_KDEWEBKIT_LIBS        - the kdewebkit library and all depending libraries
0105 #
0106 # This module defines also a bunch of variables used as locations for install directories
0107 # for files of the package which is using this module. These variables don't say
0108 # anything about the location of the installed KDE.
0109 # They can be relative (to CMAKE_INSTALL_PREFIX) or absolute.
0110 # Under Windows they are always relative.
0111 #
0112 #  BIN_INSTALL_DIR          - the directory where executables will be installed (default is prefix/bin)
0113 #  BUNDLE_INSTALL_DIR       - Mac only: the directory where application bundles will be installed (default is /Applications/KDE4 )
0114 #  SBIN_INSTALL_DIR         - the directory where system executables will be installed (default is prefix/sbin)
0115 #  LIB_INSTALL_DIR          - the directory where libraries will be installed (default is prefix/lib)
0116 #  CONFIG_INSTALL_DIR       - the directory where config files will be installed
0117 #  DATA_INSTALL_DIR         - the parent directory where applications can install their data
0118 #  HTML_INSTALL_DIR         - the directory where HTML documentation will be installed
0119 #  ICON_INSTALL_DIR         - the directory where the icons will be installed (default prefix/share/icons/)
0120 #  INFO_INSTALL_DIR         - the directory where info files will be installed (default prefix/info)
0121 #  KCFG_INSTALL_DIR         - the directory where kconfig files will be installed
0122 #  LOCALE_INSTALL_DIR       - the directory where translations will be installed
0123 #  MAN_INSTALL_DIR          - the directory where man pages will be installed (default prefix/man/)
0124 #  MIME_INSTALL_DIR         - the directory where mimetype desktop files will be installed
0125 #  PLUGIN_INSTALL_DIR       - the subdirectory relative to the install prefix where plugins will be installed (default is ${KDE4_LIB_INSTALL_DIR}/plugins/kf5)
0126 #  IMPORTS_INSTALL_DIR      - the subdirectory relative to the install prefix where imports will be installed
0127 #  SERVICES_INSTALL_DIR     - the directory where service (desktop, protocol, ...) files will be installed
0128 #  SERVICETYPES_INSTALL_DIR - the directory where servicestypes desktop files will be installed
0129 #  SOUND_INSTALL_DIR        - the directory where sound files will be installed
0130 #  TEMPLATES_INSTALL_DIR    - the directory where templates (Create new file...) will be installed
0131 #  WALLPAPER_INSTALL_DIR    - the directory where wallpapers will be installed
0132 #  AUTOSTART_INSTALL_DIR    - the directory where autostart files will be installed
0133 #  DEMO_INSTALL_DIR         - the directory where demos will be installed
0134 #  KCONF_UPDATE_INSTALL_DIR - the directory where kconf_update files will be installed
0135 #  SYSCONF_INSTALL_DIR      - the directory where sysconfig files will be installed (default /etc)
0136 #  XDG_APPS_INSTALL_DIR     - the XDG apps dir
0137 #  XDG_DIRECTORY_INSTALL_DIR- the XDG directory
0138 #  XDG_MIME_INSTALL_DIR     - the XDG mimetypes install dir
0139 #  DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces will be installed (default is prefix/share/dbus-1/interfaces)
0140 #  DBUS_SERVICES_INSTALL_DIR        - the directory where dbus services will be installed (default is prefix/share/dbus-1/services )
0141 #  DBUS_SYSTEM_SERVICES_INSTALL_DIR        - the directory where dbus system services will be installed (default is prefix/share/dbus-1/system-services )
0142 #
0143 # The variable INSTALL_TARGETS_DEFAULT_ARGS can be used when installing libraries
0144 # or executables into the default locations.
0145 # The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed.
0146 # It should also be used when installing applications, since then
0147 # on OS X application bundles will be installed to BUNDLE_INSTALL_DIR.
0148 # The variable MUST NOT be used for installing plugins.
0149 # It also MUST NOT be used for executables which are intended to go into sbin/ or libexec/.
0150 #
0151 # Usage is like this:
0152 #    install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} )
0153 #
0154 # This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go
0155 # into bin/.
0156 #
0157 #
0158 # The following variable is provided, but seem to be unused:
0159 #  LIBS_HTML_INSTALL_DIR    /share/doc/HTML            CACHE STRING "Is this still used ?")
0160 #
0161 # The following user adjustable options are provided:
0162 #
0163 #  KDE4_BUILD_TESTS  - enable this to build the testcases
0164 #  KDE4_ENABLE_FPIE  - enable it to use gcc Position Independent Executables feature
0165 #  KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE
0166 #                      If enabled, the package should install its <package>Config.cmake file to
0167 #                      lib/cmake/<package>/ instead to lib/<package>/cmake
0168 #
0169 # It also adds the following macros and functions (from KDE4Macros.cmake)
0170 #  KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui)
0171 #    Use this to add Qt designer ui files to your application/library.
0172 #
0173 #  KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui)
0174 #    Use this to add Qt designer ui files from Qt version 3 to your application/library.
0175 #
0176 #  KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc)
0177 #    Use this to add KDE config compiler files to your application/library.
0178 #    Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files.
0179 #    Use optional USE_RELATIVE_PATH to generate the classes in the build following the given
0180 #    relative path to the file.
0181 #
0182 #  KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets)
0183 #    Use this to add widget description files for the makekdewidgets code generator
0184 #    for Qt Designer plugins.
0185 #
0186 #  KDE4_ADD_PLUGIN ( name [WITH_PREFIX] file1 ... fileN )
0187 #    Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
0188 #    If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
0189 #    Do NOT use WITH_PREFIX in new code! This is for compatibility only.
0190 #
0191 #  KDE4_ADD_KDEINIT_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN)
0192 #    Create a KDE application in the form of a module loadable via kdeinit.
0193 #    A library named kdeinit_<name> will be created and a small executable which links to it.
0194 #    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
0195 #    application bundles are created, with the NOGUI option no bundles but simple executables
0196 #    are created. Under Windows this flag is also necessary to separate between applications
0197 #    with GUI and without. On other UNIX systems this flag has no effect.
0198 #    RUN_UNINSTALLED is deprecated and is ignored, for details see the documentation for
0199 #    KDE4_ADD_EXECUTABLE().
0200 #
0201 #  KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN)
0202 #    Equivalent to ADD_EXECUTABLE(), but additionally adds some more features:
0203 #    -automatic RPATH handling
0204 #    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
0205 #    application bundles are created, with the NOGUI option no bundles but simple executables
0206 #    are created. Under Windows this flag is also necessary to separate between applications
0207 #    with GUI and without. On other UNIX systems this flag has no effect.
0208 #    The option TEST is for internal use only.
0209 #    The option RUN_UNINSTALLED is ignored. It was necessary with KDE 4.0 and 4.1
0210 #    if the executable had to be run from the build tree. Since KDE 4.2 all
0211 #    executables can be always run uninstalled (the RPATH of executables which are not
0212 #    yet installed points since then into the buildtree and is changed
0213 #    to the proper location when installing, so RUN_UNINSTALLED is not necessary anymore).
0214 #
0215 #  KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN)
0216 #    Equivalent to ADD_LIBRARY().
0217 #    The RPATH is set according to the global RPATH settings as set up by FindKDE4Internal.cmake
0218 #    (CMAKE_SKIP_BUILD_RPATH=FALSE, CMAKE_BUILD_WITH_INSTALL_RPATH=FALSE, CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE)
0219 #    Under Windows it adds a -DMAKE_<name>_LIB definition to the compilation.
0220 #
0221 #  KDE4_ADD_UNIT_TEST (testname [TESTNAME targetname] file1 ... fileN)
0222 #    add a unit test, which is executed when running make test
0223 #    it will be built with RPATH poiting to the build dir
0224 #    The targets are always created, but only built for the "all"
0225 #    target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
0226 #    are created but not built by default. You can build them by manually building the target.
0227 #    The name of the target can be specified using TESTNAME <targetname>, if it is not given
0228 #    the macro will default to the <testname>
0229 #
0230 #  KDE4_ADD_APP_ICON (SRCS_VAR pattern)
0231 #  adds an application icon to target source list.
0232 #  Make sure you have a 128x128 icon, or the icon won't display on Mac OS X.
0233 #  Mac OSX notes : the application icon is added to a Mac OS X bundle so that Finder and friends show the right thing.
0234 #  Win32 notes: the application icon(s) are compiled into the application
0235 #  There is some workaround in kde4_add_kdeinit_executable to make it possible for those applications as well.
0236 # Parameters:
0237 #  SRCS_VAR  - specifies the list of source files
0238 #  pattern   - regular expression for searching application icons
0239 #  Example: KDE4_ADD_APP_ICON( myapp_SOURCES "pics/cr*-myapp.png")
0240 #  Example: KDE4_ADD_APP_ICON( myapp_KDEINIT_SRCS "icons/oxygen/*/apps/myapp.png")
0241 #
0242 #  KDE4_UPDATE_ICONCACHE()
0243 #    Notifies the icon cache that new icons have been installed by updating
0244 #    mtime of ${ICON_INSTALL_DIR}/hicolor directory.
0245 #
0246 #  KDE4_INSTALL_ICONS( path theme)
0247 #    Installs all png and svgz files in the current directory to the icon
0248 #    directory given in path, in the subdirectory for the given icon theme.
0249 #
0250 #  KDE4_INSTALL_AUTH_ACTIONS( HELPER_ID ACTIONS_FILE )
0251 #   This macro generates an action file, depending on the backend used, for applications using KAuth.
0252 #   It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example
0253 #   for file format). The macro will take care of generating the file according to the backend specified,
0254 #   and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy
0255 #   file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/),
0256 #   and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during
0257 #   the install phase
0258 #
0259 #  KDE4_INSTALL_AUTH_HELPER_FILES( HELPER_TARGET HELPER_ID HELPER_USER )
0260 #   This macro adds the needed files for an helper executable meant to be used by applications using KAuth.
0261 #   It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on.
0262 #   This macro takes care of generate the needed files, and install them in the right location. This boils down
0263 #   to a DBus policy to let the helper register on the system bus, and a service file for letting the helper
0264 #   being automatically activated by the system bus.
0265 #   *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work.
0266 #
0267 #
0268 #
0269 #  A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles
0270 #  the flags for those buildtypes. FindKDE4Internal supports the values
0271 #  Debug, Release, RelWithDebInfo, Profile and Debugfull:
0272 #
0273 #  Release
0274 #          optimised for speed, qDebug/kDebug turned off, no debug symbols, no asserts
0275 #  RelWithDebInfo (Release with debug info)
0276 #          similar to Release, optimised for speed, but with debugging symbols on (-g)
0277 #  Debug
0278 #          optimised but debuggable, debugging on (-g)
0279 #          (-fno-reorder-blocks -fno-schedule-insns -fno-inline)
0280 #  DebugFull
0281 #          no optimization, full debugging on (-g3)
0282 #  Profile
0283 #          DebugFull + -ftest-coverage -fprofile-arcs
0284 #
0285 #
0286 #  The default buildtype is RelWithDebInfo.
0287 #  It is expected that the "Debug" build type be still debuggable with gdb
0288 #  without going all over the place, but still produce better performance.
0289 #  It's also important to note that gcc cannot detect all warning conditions
0290 #  unless the optimiser is active.
0291 #
0292 #
0293 #  This module allows to depend on a particular minimum version of kdelibs.
0294 #  To acomplish that one should use the appropriate cmake syntax for
0295 #  find_package. For example to depend on kdelibs >= 4.1.0 one should use
0296 #
0297 #  find_package(KDE4 4.1.0 REQUIRED)
0298 #
0299 #  In earlier versions of KDE you could use the variable KDE_MIN_VERSION to
0300 #  have such a dependency. This variable is deprecated with KDE 4.2.0, but
0301 #  will still work to make the module backwards-compatible.
0302 
0303 #  _KDE4_PLATFORM_INCLUDE_DIRS is used only internally
0304 #  _KDE4_PLATFORM_DEFINITIONS is used only internally
0305 
0306 # Copyright (c) 2006-2009, Alexander Neundorf <neundorf@kde.org>
0307 # Copyright (c) 2006, Laurent Montel, <montel@kde.org>
0308 #
0309 # Redistribution and use is allowed according to the terms of the BSD license.
0310 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0311 
0312 
0313 # this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below
0314 cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
0315 # set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3)
0316 cmake_policy(VERSION 2.4.5)
0317 
0318 # CMake 2.6, set compatibility behaviour to cmake 2.4
0319 # this must be executed always, because the CMAKE_MINIMUM_REQUIRED() command above
0320 # resets the policy settings, so we get a lot of warnings
0321 
0322 # CMP0000: don't require cmake_minimum_version() directly in the top level CMakeLists.txt, FindKDE4Internal.cmake is good enough
0323 cmake_policy(SET CMP0000 OLD)
0324 # CMP0002: in KDE4 we have multiple targets with the same name for the unit tests
0325 cmake_policy(SET CMP0002 OLD)
0326 # CMP0003: add the link paths to the link command as with cmake 2.4
0327 cmake_policy(SET CMP0003 OLD)
0328 # CMP0005: keep escaping behaviour for definitions added via add_definitions()
0329 cmake_policy(SET CMP0005 OLD)
0330 # since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file
0331 # where this is done, macros and functions are executed with the policies as they
0332 # were when the were defined. Keep the OLD behaviour so we can set the policies here
0333 # for all KDE software without the big warning
0334 cmake_policy(SET CMP0011 OLD)
0335 
0336 # since cmake 2.8.4: when include()ing from inside cmake's module dir, prefer the files
0337 # in this directory over those from CMAKE_MODULE_PATH
0338 cmake_policy(SET CMP0017 NEW)
0339 
0340 # get the directory of the current file, used later on in the file
0341 get_filename_component( kde_cmake_module_dir  ${CMAKE_CURRENT_LIST_FILE} PATH)
0342 
0343 # This file is only used when building kdelibs itself. When using an installed
0344 # kdelibs, KDELibs4Config.cmake is loaded instead.
0345 # then enter bootstrap mode
0346 set(_kdeBootStrapping TRUE)
0347 message(STATUS "Building kdelibs...")
0348 
0349 
0350 # We may only search for other packages with "REQUIRED" if we are required ourselves.
0351 # This file can be processed either (usually) included in FindKDE4.cmake or
0352 # (when building kdelibs) directly via FIND_PACKAGE(KDE4Internal), that's why
0353 # we have to check for both KDE4_FIND_REQUIRED and KDE4Internal_FIND_REQUIRED.
0354 set(_REQ_STRING_KDE4 "REQUIRED")
0355 set(_REQ_STRING_KDE4_MESSAGE "FATAL_ERROR")
0356 
0357 # now we are sure we have everything we need
0358 include (MacroLibrary)
0359 include (CheckCXXCompilerFlag)
0360 include (CheckCXXSourceCompiles)
0361 
0362 
0363 # helper macro, sets both the KDE4_FOO_LIBRARY and KDE4_FOO_LIBS variables to KDE4__foo
0364 # It is used both in bootstrapping and in normal mode.
0365 macro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
0366    set(KDE4_${_var}_LIBRARY ${_prefix}${_lib} )
0367    set(KDE4_${_var}_LIBS    ${_prefix}${_lib} )
0368 endmacro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
0369 
0370 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
0371   set (KDE4_ENABLE_EXCEPTIONS -EHsc)
0372 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
0373   set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")
0374 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
0375   set (KDE4_ENABLE_EXCEPTIONS -fexceptions)
0376 endif()
0377 
0378 #######################  #now try to find some kde stuff  ################################
0379 
0380 set(KDE4_INCLUDE_DIR ${kdelibs_SOURCE_DIR})
0381 
0382 set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin )
0383 
0384 if (WIN32)
0385    set(LIBRARY_OUTPUT_PATH               ${EXECUTABLE_OUTPUT_PATH} )
0386    # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC
0387    if (NOT WINCE)
0388      set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler_kf5 )
0389    else (NOT WINCE)
0390      set(KDE4_KCFGC_EXECUTABLE             ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/kconfig_compiler_kf5 )
0391    endif(NOT WINCE)
0392 
0393    set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen )
0394    set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets )
0395 else (WIN32)
0396    set(LIBRARY_OUTPUT_PATH               ${CMAKE_BINARY_DIR}/lib )
0397    set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler_kf5${CMAKE_EXECUTABLE_SUFFIX}.shell )
0398    set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen${CMAKE_EXECUTABLE_SUFFIX}.shell )
0399    set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell )
0400 endif (WIN32)
0401 
0402 set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
0403 
0404 
0405 # when building kdelibs, make the kcfg rules depend on the binaries...
0406 set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler_kf5)
0407 set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP kauth-policy-gen)
0408 set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets)
0409 
0410 set(KDE4_INSTALLED_VERSION_OK TRUE)
0411 
0412 
0413 # Set the various KDE4_FOO_LIBRARY/LIBS variables.
0414 # In bootstrapping mode KDE4_TARGET_PREFIX is empty, so e.g. KDE4_KDECORE_LIBRARY
0415 # will be simply set to "kdecore".
0416 
0417 # Sorted by names:
0418 _kde4_set_lib_variables(KCMUTILS      kcmutils      "${KDE4_TARGET_PREFIX}")
0419 _kde4_set_lib_variables(KDECORE_UNPORTED       kdecore       "${KDE4_TARGET_PREFIX}")
0420 _kde4_set_lib_variables(KDEUI_UNPORTED         kdeui         "${KDE4_TARGET_PREFIX}")
0421 _kde4_set_lib_variables(KDEWEBKIT     kdewebkit     "${KDE4_TARGET_PREFIX}")
0422 _kde4_set_lib_variables(KDNSSD        kdnssd        "${KDE4_TARGET_PREFIX}")
0423 _kde4_set_lib_variables(KEMOTICONS    kemoticons    "${KDE4_TARGET_PREFIX}")
0424 _kde4_set_lib_variables(KHTML         khtml         "${KDE4_TARGET_PREFIX}")
0425 _kde4_set_lib_variables(KIDLETIME     KIdleTime     "${KDE4_TARGET_PREFIX}")
0426 _kde4_set_lib_variables(KIO           kio           "${KDE4_TARGET_PREFIX}")
0427 _kde4_set_lib_variables(KJS           kjs           "${KDE4_TARGET_PREFIX}")
0428 _kde4_set_lib_variables(KJSAPI        kjsapi        "${KDE4_TARGET_PREFIX}")
0429 _kde4_set_lib_variables(KNEWSTUFF2    knewstuff2    "${KDE4_TARGET_PREFIX}")
0430 _kde4_set_lib_variables(KNEWSTUFF3    knewstuff3    "${KDE4_TARGET_PREFIX}")
0431 _kde4_set_lib_variables(KNOTIFYCONFIG knotifyconfig "${KDE4_TARGET_PREFIX}")
0432 _kde4_set_lib_variables(KPARTS        kparts        "${KDE4_TARGET_PREFIX}")
0433 _kde4_set_lib_variables(KPRINTUTILS   kprintutils   "${KDE4_TARGET_PREFIX}")
0434 _kde4_set_lib_variables(KROSSCORE     krosscore     "${KDE4_TARGET_PREFIX}")
0435 _kde4_set_lib_variables(KROSSUI       krossui       "${KDE4_TARGET_PREFIX}")
0436 _kde4_set_lib_variables(KTEXTEDITOR   ktexteditor   "${KDE4_TARGET_PREFIX}")
0437 _kde4_set_lib_variables(KUNITCONVERSION kunitconversion "${KDE4_TARGET_PREFIX}")
0438 _kde4_set_lib_variables(KUTILS        kutils        "${KDE4_TARGET_PREFIX}")
0439 _kde4_set_lib_variables(PLASMA        plasma        "${KDE4_TARGET_PREFIX}")
0440 _kde4_set_lib_variables(SOLID         Solid         "${KDE4_TARGET_PREFIX}")
0441 _kde4_set_lib_variables(THREADWEAVER  ThreadWeaver  "${KDE4_TARGET_PREFIX}")
0442 
0443 set(KDE4_KDEUI_LIBRARY ${KDE4_KDEUI_UNPORTED_LIBRARY} )
0444 set(KDE4_KDEUI_LIBS    ${KDE4_KDEUI_LIBRARY} )
0445 set(KDE4_KDECORE_LIBS  ${KDE4_KDECORE_UNPORTED_LIBRARY} )
0446 
0447 if (UNIX)
0448    _kde4_set_lib_variables(KDESU kdesu       "${KDE4_TARGET_PREFIX}")
0449    _kde4_set_lib_variables(KPTY kpty         "${KDE4_TARGET_PREFIX}")
0450 endif (UNIX)
0451 
0452 # The nepomuk target does not always exist, since is is built conditionally. When bootstrapping
0453 # we set it always anyways.
0454 _kde4_set_lib_variables(NEPOMUK nepomuk "${KDE4_TARGET_PREFIX}")
0455 
0456 #####################  provide some options   ##########################################
0457 
0458 option(KDE4_BUILD_TESTS  "Build the tests" ON)
0459 option(KDE4_ENABLE_HTMLHANDBOOK  "Create targets htmlhandbook for creating the html versions of the docbook docs")
0460 set(KDE4_SERIALIZE_TOOL "" CACHE STRING "Tool to serialize resource-intensive commands in parallel builds")
0461 
0462 # if CMake 2.6.3 or above is used, provide an option which should be used by other KDE packages
0463 # whether to install a CMake FooConfig.cmake into lib/foo/cmake/ or /lib/cmake/foo/
0464 # (with 2.6.3 and above also lib/cmake/foo/ is supported):
0465 if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
0466    option(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR "Prefer to install the <package>Config.cmake files to lib/cmake/<package> instead to lib/<package>/cmake" TRUE)
0467 else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
0468    set(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR  FALSE)
0469 endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
0470 
0471 if (WIN32)
0472    list(APPEND CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/share/apps/cmake/modules")
0473    find_package(KDEWin REQUIRED)
0474    option(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF)
0475    if (KDE4_ENABLE_UAC_MANIFEST)
0476       find_program(KDE4_MT_EXECUTABLE mt
0477          PATHS ${KDEWIN_INCLUDE_DIR}/../bin
0478          NO_DEFAULT_PATH
0479       )
0480       if (KDE4_MT_EXECUTABLE)
0481          message(STATUS "Found KDE manifest tool at ${KDE4_MT_EXECUTABLE} ")
0482       else (KDE4_MT_EXECUTABLE)
0483          message(STATUS "KDE manifest tool not found, manifest generating for Windows Vista disabled")
0484          set (KDE4_ENABLE_UAC_MANIFEST OFF)
0485       endif (KDE4_MT_EXECUTABLE)
0486    endif (KDE4_ENABLE_UAC_MANIFEST)
0487 endif (WIN32)
0488 
0489 ##############  add some more default search paths  ###############
0490 #
0491 # the KDE4_xxx_INSTALL_DIR variables are empty when building kdelibs itself
0492 # and otherwise point to the kde4 install dirs
0493 
0494 set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
0495                               "${KDE4_INCLUDE_INSTALL_DIR}")
0496 
0497 set(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
0498                               "${KDE4_BIN_INSTALL_DIR}" )
0499 
0500 set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
0501                               "${KDE4_LIB_INSTALL_DIR}" )
0502 
0503 # under Windows dlls may be also installed in bin/
0504 if(WIN32)
0505   set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
0506                                 "${_CMAKE_INSTALL_DIR}/bin"
0507                                 "${CMAKE_INSTALL_PREFIX}/bin" )
0508 endif(WIN32)
0509 
0510 
0511 ######################################################
0512 #  and now the platform specific stuff
0513 ######################################################
0514 
0515 if (WIN32)
0516 
0517    if(CYGWIN)
0518       message(FATAL_ERROR "Cygwin is NOT supported, use mingw or MSVC to build KDE4.")
0519    endif(CYGWIN)
0520 
0521    # limit win32 packaging to kdelibs at now
0522    # don't know if package name, version and notes are always available
0523    find_package(KDEWIN_Packager)
0524    if (KDEWIN_PACKAGER_FOUND)
0525       kdewin_packager("kdelibs" "${KDE_VERSION}" "KDE base library" "")
0526    endif (KDEWIN_PACKAGER_FOUND)
0527 
0528    include(Win32Macros)
0529    addExplorerWrapper("kdelibs")
0530 
0531    set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN_INCLUDES})
0532 
0533    # if we are compiling kdelibs, add KDEWIN_LIBRARIES explicitly,
0534    # otherwise they come from KDELibsDependencies.cmake, Alex
0535    set( KDE4_KDECORE_LIBS ${KDE4_KDECORE_LIBS} ${KDEWIN_LIBRARIES} )
0536 
0537    # for visual studio IDE set the path correctly for custom commands
0538    # maybe under windows bat-files should be generated for running apps during the build
0539    if(MSVC_IDE)
0540      get_filename_component(PERL_LOCATION "${PERL_EXECUTABLE}" PATH)
0541      file(TO_NATIVE_PATH "${PERL_LOCATION}" PERL_PATH_WINDOWS)
0542      file(TO_NATIVE_PATH "${QT_BINARY_DIR}" QT_BIN_DIR_WINDOWS)
0543      set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}"
0544        CACHE STATIC "MSVC IDE Run path" FORCE)
0545    endif(MSVC_IDE)
0546 
0547 endif (WIN32)
0548 
0549 
0550 if (UNIX)
0551    set( _KDE4_PLATFORM_INCLUDE_DIRS)
0552 endif (UNIX)
0553 
0554 
0555 if (Q_WS_X11)
0556    # Done by FindQt4.cmake already
0557    #find_package(X11 REQUIRED)
0558    # UNIX has already set _KDE4_PLATFORM_INCLUDE_DIRS, so append
0559    set(_KDE4_PLATFORM_INCLUDE_DIRS ${_KDE4_PLATFORM_INCLUDE_DIRS} ${X11_INCLUDE_DIR} )
0560 endif (Q_WS_X11)
0561 
0562 
0563 ############################################################
0564 # compiler specific settings
0565 ############################################################
0566 
0567 
0568 # this macro is for internal use only.
0569 macro(KDE_CHECK_FLAG_EXISTS FLAG VAR DOC)
0570    if(NOT ${VAR} MATCHES "${FLAG}")
0571       set(${VAR} "${${VAR}} ${FLAG}" CACHE STRING "Flags used by the linker during ${DOC} builds." FORCE)
0572    endif(NOT ${VAR} MATCHES "${FLAG}")
0573 endmacro(KDE_CHECK_FLAG_EXISTS FLAG VAR)
0574 
0575 # This macro is for internal use only
0576 # Return the directories present in gcc's include path.
0577 macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result)
0578   set(${_result})
0579   set(_gccOutput)
0580   file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
0581   execute_process(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
0582                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
0583                   ERROR_VARIABLE _gccOutput
0584                   OUTPUT_VARIABLE _gccStdout )
0585   file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
0586 
0587   if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
0588     SET(${_result} ${CMAKE_MATCH_1})
0589     STRING(REPLACE "\n" " " ${_result} "${${_result}}")
0590     SEPARATE_ARGUMENTS(${_result})
0591   ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
0592 ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
0593 
0594 if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
0595    _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs)
0596    set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
0597        ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
0598 endif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
0599 
0600 if (CMAKE_COMPILER_IS_GNUCXX)
0601    _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
0602    set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
0603 
0604 endif (CMAKE_COMPILER_IS_GNUCXX)
0605 
0606 
0607 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
0608    _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
0609    set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
0610        ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
0611    # Select flags.
0612    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
0613    set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DQT_NO_DEBUG")
0614    set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-inline")
0615    set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
0616    set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
0617    set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
0618    set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG -DQT_NO_DEBUG")
0619    set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-inline")
0620    set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
0621    set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
0622 
0623    set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
0624    # As of Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
0625    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -Woverloaded-virtual -fno-exceptions -DQT_NO_EXCEPTIONS -fno-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden")
0626    set(KDE4_C_FLAGS    "-fvisibility=hidden")
0627 
0628    # There is a lot of code out there that includes headers that throw
0629    # exceptions, but we disable exceptions by default.
0630    # GCC, MSVC and ICC do not complain about these cases when the exceptions
0631    # are thrown inside some template code that is not expanded/used, which is
0632    # what happens most of the time.
0633    # We have to follow suit and be less strict in order not to break the build
0634    # in many places.
0635    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdelayed-template-parsing")
0636 
0637    # At least kdepim exports one function with C linkage that returns a
0638    # QString in a plugin, but clang does not like that.
0639    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
0640 
0641    set(KDE4_CXX_FPIE_FLAGS "-fPIE")
0642    set(KDE4_PIE_LDFLAGS    "-pie")
0643 
0644    if (CMAKE_SYSTEM_NAME STREQUAL GNU)
0645       set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
0646       set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
0647    endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
0648 
0649    set(__KDE_HAVE_GCC_VISIBILITY TRUE)
0650 
0651    # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default")))
0652    # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break
0653    set(_source "#include <QtCore/QtGlobal>\n int main()\n {\n #ifndef QT_VISIBILITY_AVAILABLE \n #error QT_VISIBILITY_AVAILABLE is not available\n #endif \n }\n")
0654    set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp)
0655    file(WRITE "${_source_file}" "${_source}")
0656    set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}")
0657    try_compile(_compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" OUTPUT_VARIABLE _compile_output_var)
0658    if(NOT _compile_result)
0659        message("${_compile_output_var}")
0660        message(FATAL_ERROR "Qt compiled without support for -fvisibility=hidden. This will break plugins and linking of some applications. Please fix your Qt installation (try passing --reduce-exports to configure).")
0661    endif(NOT _compile_result)
0662 endif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
0663 
0664 
0665 ###########    end of platform specific stuff  ##########################
0666 
0667 
0668 #add the found Qt and KDE include directories to the current include path
0669 #the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include <KMainWindow>
0670 set(KDE4_INCLUDES
0671    ${KDE4_INCLUDE_DIR}
0672    ${KDE4_INCLUDE_DIR}/KDE
0673    ${QT_INCLUDES}
0674    ${_KDE4_PLATFORM_INCLUDE_DIRS}
0675 )
0676 
0677 # Used by kdebug.h: the "toplevel dir" is one level above CMAKE_SOURCE_DIR
0678 get_filename_component(_KDE4_CMAKE_TOPLEVEL_DIR "${CMAKE_SOURCE_DIR}/.." ABSOLUTE)
0679 string(LENGTH "${_KDE4_CMAKE_TOPLEVEL_DIR}" _KDE4_CMAKE_TOPLEVEL_DIR_LENGTH)
0680 
0681 set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=${_KDE4_CMAKE_TOPLEVEL_DIR_LENGTH})
0682 
0683 if (NOT _kde4_uninstall_rule_created)
0684    set(_kde4_uninstall_rule_created TRUE)
0685 
0686    configure_file("${kde_cmake_module_dir}/kde4_cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY)
0687 
0688    add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
0689 
0690 endif (NOT _kde4_uninstall_rule_created)
0691