diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/FindEigen2.cmake | 5 | ||||
| -rw-r--r-- | modules/FindHUNSPELL.cmake | 25 | ||||
| -rw-r--r-- | modules/FindKDE4Internal.cmake | 132 | ||||
| -rw-r--r-- | modules/FindKDEWin.cmake | 65 | ||||
| -rw-r--r-- | modules/FindLCMS.cmake | 28 | ||||
| -rw-r--r-- | modules/FindMySQL.cmake | 10 | ||||
| -rw-r--r-- | modules/FindPolkitQt.cmake | 70 | ||||
| -rw-r--r-- | modules/FindQt4.cmake | 4 | ||||
| -rw-r--r-- | modules/FindSasl2.cmake | 4 | ||||
| -rw-r--r-- | modules/FindSharedMimeInfo.cmake | 2 | ||||
| -rw-r--r-- | modules/FindSoprano.cmake | 14 | ||||
| -rw-r--r-- | modules/KDE4Defaults.cmake | 4 | ||||
| -rw-r--r-- | modules/KDE4Macros.cmake | 133 | ||||
| -rw-r--r-- | modules/MacroKAuth.cmake | 3 | ||||
| -rw-r--r-- | modules/SIPMacros.cmake | 8 | ||||
| -rw-r--r-- | modules/kde4uic.cmake | 21 | 
16 files changed, 383 insertions, 145 deletions
| diff --git a/modules/FindEigen2.cmake b/modules/FindEigen2.cmake index 8679a36b..0e86aaf2 100644 --- a/modules/FindEigen2.cmake +++ b/modules/FindEigen2.cmake @@ -1,4 +1,9 @@  # - Try to find Eigen2 lib +# +# This module supports requiring a minimum version, e.g. you can do +#   find_package(Eigen2 2.0.3) +# to require version 2.0.3 to newer of Eigen2. +#  # Once done this will define  #  #  EIGEN2_FOUND - system has eigen lib with correct version diff --git a/modules/FindHUNSPELL.cmake b/modules/FindHUNSPELL.cmake new file mode 100644 index 00000000..30f37730 --- /dev/null +++ b/modules/FindHUNSPELL.cmake @@ -0,0 +1,25 @@ +# - Try to find HUNSPELL +# Once done this will define +# +#  HUNSPELL_FOUND - system has HUNSPELL +#  HUNSPELL_INCLUDE_DIR - the HUNSPELL include directory +#  HUNSPELL_LIBRARIES - The libraries needed to use HUNSPELL +#  HUNSPELL_DEFINITIONS - Compiler switches required for using HUNSPELL + + +IF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES) +  # Already in cache, be silent +  SET(HUNSPELL_FIND_QUIETLY TRUE) +ENDIF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES) + +FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx ) + +FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.2) + +# handle the QUIETLY and REQUIRED arguments and set HUNSPELL_FOUND to TRUE if  +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR) + + +MARK_AS_ADVANCED(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES) diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index e3478339..75cb9988 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -43,6 +43,7 @@  #  KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library  #  KDE4_NEPOMUK_LIBRARY    - the nepomuk library  #  KDE4_PLASMA_LIBRARY      - the plasma library +#  KDE4_KUNITCONVERSION_LIBRARY - the kunitconversion library  #  #  KDE4_PLASMA_OPENGL_FOUND  - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise  # @@ -73,8 +74,9 @@  #  KDE4_KTEXTEDITOR_LIBS      - the ktexteditor library and all depending libraries  #  KDE4_NEPOMUK_LIBS         - the nepomuk library and all depending libraries  #  KDE4_PLASMA_LIBS           - the plasma library and all depending librairies +#  KDE4_KUNITCONVERSION_LIBS  - the kunitconversion library and all depending libraries  # -# This module defines a bunch of variables used as locations for install directories.  +# This module defines a bunch of variables used as locations for install directories.  # They can be relative (to CMAKE_INSTALL_PREFIX) or absolute.  # Under Windows they are always relative.  # @@ -104,6 +106,7 @@  #  XDG_MIME_INSTALL_DIR     - the XDG mimetypes install dir  #  DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces be installed (default is prefix/share/dbus-1/interfaces)  #  DBUS_SERVICES_INSTALL_DIR        - the directory where dbus services be installed (default is prefix/share/dbus-1/services ) +#  DBUS_SYSTEM_SERVICES_INSTALL_DIR        - the directory where dbus system services be installed (default is prefix/share/dbus-1/system-services )  #  # The following variable is provided, but seem to be unused:  #  LIBS_HTML_INSTALL_DIR    /share/doc/HTML            CACHE STRING "Is this still used ?") @@ -114,7 +117,7 @@  #  KDE4_BUILD_TESTS  - enable this to build the testcases  #  KDE4_ENABLE_FPIE  - enable it to use gcc Position Independent Executables feature  #  KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE -#                      If enabled, the package should install its <package>Config.cmake file to  +#                      If enabled, the package should install its <package>Config.cmake file to  #                      lib/cmake/<package>/ instead to lib/<package>/cmake  #  # It also adds the following macros and functions (from KDE4Macros.cmake) @@ -124,9 +127,11 @@  #  KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui)  #    Use this to add Qt designer ui files from Qt version 3 to your application/library.  # -#  KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] file1.kcfgc ... fileN.kcfgc) +#  KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc)  #    Use this to add KDE config compiler files to your application/library.  #    Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files. +#    Use optional USE_RELATIVE_PATH to generate the classes in the build following the given +#    relative path to the file.  #  #  KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets)  #    Use this to add widget description files for the makekdewidgets code generator @@ -147,22 +152,28 @@  #    Create a KDE application in the form of a module loadable via kdeinit.  #    A library named kdeinit_<name> will be created and a small executable which links to it.  #    It supports KDE4_ENABLE_FINAL -#    If the executable has to be run from the buildtree (e.g. unit tests and code generators -#    used later on when compiling), set the option RUN_UNINSTALLED.  #    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X  #    application bundles are created, with the NOGUI option no bundles but simple executables -#    are created. Currently it doesn't have any effect on other platforms. +#    are created. Under Windows this flag is also necessary to separate between applications +#    with GUI and without. On other UNIX systems this flag has no effect. +#    RUN_UNINSTALLED is deprecated and is ignored, for details see the documentation for +#    KDE4_ADD_EXECUTABLE().  #  #  KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN)  #    Equivalent to ADD_EXECUTABLE(), but additionally adds some more features:  #    -support for KDE4_ENABLE_FINAL  #    -support for automoc  #    -automatic RPATH handling -#    If the executable has to be run from the buildtree (e.g. unit tests and code generators -#    used later on when compiling), set the option RUN_UNINSTALLED.  #    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X  #    application bundles are created, with the NOGUI option no bundles but simple executables -#    are created. Currently it doesn't have any effect on other platforms. +#    are created. Under Windows this flag is also necessary to separate between applications +#    with GUI and without. On other UNIX systems this flag has no effect. +#    The option TEST is for internal use only. +#    The option RUN_UNINSTALLED is ignored. It was necessary with KDE 4.0 and 4.1  +#    if the executable had to be run from the build tree. Since KDE 4.2 all +#    executables can be always run uninstalled (the RPATH of executables which are not +#    yet installed points since then into the buildtree and is changed +#    to the proper location when installing, so RUN_UNINSTALLED is not necessary anymore).  #  #  KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN)  #    Equivalent to ADD_LIBRARY(), but additionally it supports KDE4_ENABLE_FINAL @@ -199,6 +210,24 @@  #   INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if  #   SUBDIR <subdir> is specified.  # +#  KDE4_INSTALL_AUTH_ACTIONS( HELPER_ID ACTIONS_FILE ) +#   This macro generates an action file, depending on the backend used, for applications using KAuth. +#   It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example +#   for file format). The macro will take care of generating the file according to the backend specified,  +#   and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy +#   file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/), +#   and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during +#   the install phase +# +#  KDE4_INSTALL_AUTH_HELPER_FILES( HELPER_TARGET HELPER_ID HELPER_USER ) +#   This macro adds the needed files for an helper executable meant to be used by applications using KAuth. +#   It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on. +#   This macro takes care of generate the needed files, and install them in the right location. This boils down +#   to a DBus policy to let the helper register on the system bus, and a service file for letting the helper +#   being automatically activated by the system bus. +#   *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work. +# +#  #  #  A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles  #  the flags for those buildtypes. FindKDE4Internal supports the values @@ -258,7 +287,7 @@ cmake_policy(SET CMP0002 OLD)  cmake_policy(SET CMP0003 OLD)  # CMP0005: keep escaping behaviour for definitions added via add_definitions()  cmake_policy(SET CMP0005 OLD) -# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file  +# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file  # where this is done, macros and functions are executed with the policies as they  # were when the were defined. Keep the OLD behaviour so we can set the policies here  # for all KDE software without the big warning @@ -284,7 +313,16 @@ else(KDE4_FIND_REQUIRED  OR  KDE4Internal_FIND_REQUIRED)    set(_REQ_STRING_KDE4_MESSAGE "STATUS")  endif(KDE4_FIND_REQUIRED  OR  KDE4Internal_FIND_REQUIRED) -set(QT_MIN_VERSION "4.5.0") +# if the minimum Qt requirement is changed, change all occurrence in the +# following lines +if( NOT QT_MIN_VERSION ) +  set(QT_MIN_VERSION "4.5.0") +endif( NOT QT_MIN_VERSION ) +if( ${QT_MIN_VERSION} VERSION_LESS "4.5.0" ) +  set(QT_MIN_VERSION "4.5.0") +endif( ${QT_MIN_VERSION} VERSION_LESS "4.5.0" ) + +  #this line includes FindQt4.cmake, which searches the Qt library and headers  find_package(Qt4 ${_REQ_STRING_KDE4}) @@ -316,9 +354,9 @@ endif(NOT PERL_FOUND)  # Check that we really found everything. -# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found  +# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found  # already above in the other FIND_PACKAGE() calls. -# If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found,  +# If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found,  # then we get here and must check that everything has actually been found. If something is missing,  # we must not fail with FATAL_ERROR, but only not set KDE4_FOUND. @@ -381,24 +419,26 @@ if (_kdeBootStrapping)     set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin )     if (WIN32) -      set(LIBRARY_OUTPUT_PATH            ${EXECUTABLE_OUTPUT_PATH} ) +      set(LIBRARY_OUTPUT_PATH               ${EXECUTABLE_OUTPUT_PATH} )        # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC -      set(KDE4_KCFGC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler ) +      set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler ) -      set(KDE4_MEINPROC_EXECUTABLE       ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 ) -      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets ) +      set(KDE4_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 ) +      set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen ) +      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets )     else (WIN32) -      set(LIBRARY_OUTPUT_PATH            ${CMAKE_BINARY_DIR}/lib ) -      set(KDE4_KCFGC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler.shell ) - -      set(KDE4_MEINPROC_EXECUTABLE       ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4.shell ) -      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets.shell ) +      set(LIBRARY_OUTPUT_PATH               ${CMAKE_BINARY_DIR}/lib ) +      set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler${CMAKE_EXECUTABLE_SUFFIX}.shell ) +      set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen${CMAKE_EXECUTABLE_SUFFIX}.shell ) +      set(KDE4_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4${CMAKE_EXECUTABLE_SUFFIX}.shell ) +      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell )     endif (WIN32)     set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})     # when building kdelibs, make the kcfg rules depend on the binaries...     set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler) +   set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP kauth-policy-gen)     set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets)     set( _KDE4_MEINPROC_EXECUTABLE_DEP meinproc4) @@ -410,15 +450,16 @@ else (_kdeBootStrapping)     set( _KDE4_KCONFIG_COMPILER_DEP)     set( _KDE4_MAKEKDEWIDGETS_DEP)     set( _KDE4_MEINPROC_EXECUTABLE_DEP) +   set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP)     set(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib )     if (WIN32) -      # we don't want to be forced to set two paths into the build tree  +      # we don't want to be forced to set two paths into the build tree        set(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin )        # on win32 the install dir is determined on runtime not install time -      # KDELIBS_INSTALL_DIR and QT_INSTALL_DIR are used in KDELibsDependencies.cmake to setup  +      # KDELIBS_INSTALL_DIR and QT_INSTALL_DIR are used in KDELibsDependencies.cmake to setup        # kde install paths and library dependencies        get_filename_component(_DIR ${KDE4_KDECONFIG_EXECUTABLE} PATH )        get_filename_component(KDE4_INSTALL_DIR ${_DIR} PATH ) @@ -445,7 +486,7 @@ else (_kdeBootStrapping)     # This file contains the exported library target from kdelibs (new with cmake 2.6.x), e.g.     # the library target "kdeui" is exported as "KDE4__kdeui". The "KDE4__" is used as -   # "namespace" to separate the imported targets from "normal" targets, it is stored in  +   # "namespace" to separate the imported targets from "normal" targets, it is stored in     # KDE4_TARGET_PREFIX, which is set in KDELibsDependencies.cmake .     # Include it to "import" the libraries from kdelibs into the current projects as targets.     # This makes setting the _LIBRARY and _LIBS variables actually a bit superfluos, since e.g. @@ -476,6 +517,7 @@ else (_kdeBootStrapping)     _kde4_set_lib_variables(KROSSCORE     krosscore     ${KDE4_TARGET_PREFIX})     _kde4_set_lib_variables(KROSSUI       krossui       ${KDE4_TARGET_PREFIX})     _kde4_set_lib_variables(KTEXTEDITOR   ktexteditor   ${KDE4_TARGET_PREFIX}) +   _kde4_set_lib_variables(KUNITCONVERSION kunitconversion ${KDE4_TARGET_PREFIX})     _kde4_set_lib_variables(PLASMA        plasma        ${KDE4_TARGET_PREFIX})     _kde4_set_lib_variables(SOLID         solid         ${KDE4_TARGET_PREFIX})     _kde4_set_lib_variables(THREADWEAVER  threadweaver  ${KDE4_TARGET_PREFIX}) @@ -501,7 +543,7 @@ else (_kdeBootStrapping)     set(KDE4_INCLUDE_DIR ${KDE4_INCLUDE_INSTALL_DIR} ) -   # This setting is currently not recorded in KDELibsDependencies.cmake:  +   # This setting is currently not recorded in KDELibsDependencies.cmake:     find_file(KDE4_PLASMA_OPENGL_FOUND plasma/glapplet.h PATHS ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH)     # now include the file with the imported tools (executable targets) @@ -513,9 +555,10 @@ else (_kdeBootStrapping)     get_target_property(_importedConfigurations  ${KDE4_TARGET_PREFIX}kconfig_compiler IMPORTED_CONFIGURATIONS )     list(GET _importedConfigurations 0 _firstConfig) -   get_target_property(KDE4_KCFGC_EXECUTABLE          ${KDE4_TARGET_PREFIX}kconfig_compiler LOCATION_${_firstConfig}) -   get_target_property(KDE4_MEINPROC_EXECUTABLE       ${KDE4_TARGET_PREFIX}meinproc4        LOCATION_${_firstConfig}) -   get_target_property(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${KDE4_TARGET_PREFIX}makekdewidgets   LOCATION_${_firstConfig}) +   get_target_property(KDE4_KCFGC_EXECUTABLE             ${KDE4_TARGET_PREFIX}kconfig_compiler    LOCATION_${_firstConfig}) +   get_target_property(KDE4_MEINPROC_EXECUTABLE          ${KDE4_TARGET_PREFIX}meinproc4           LOCATION_${_firstConfig}) +   get_target_property(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${KDE4_TARGET_PREFIX}kauth-policy-gen    LOCATION_${_firstConfig}) +   get_target_property(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${KDE4_TARGET_PREFIX}makekdewidgets      LOCATION_${_firstConfig})     # allow searching cmake modules in all given kde install locations (KDEDIRS based)     execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -584,7 +627,7 @@ option(KDE4_ENABLE_FPIE  "Enable platform supports PIE linking")  if (WIN32)     find_package(KDEWin REQUIRED) -   OPTION(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF) +   option(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF)     if (KDE4_ENABLE_UAC_MANIFEST)        find_program(KDE4_MT_EXECUTABLE mt           PATHS ${KDEWIN_INCLUDE_DIR}/../bin @@ -664,6 +707,7 @@ if (WIN32)     set(INFO_INSTALL_DIR          "share/info"                ) # The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)")     set(DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" ) # The kde dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")     set(DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services"     ) # The kde dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)") +   set(DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services"     ) # The kde dbus system services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")  else (WIN32) @@ -735,12 +779,13 @@ else (WIN32)     _set_fancy(INFO_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/info"           "The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)")     _set_fancy(DBUS_INTERFACES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The kde dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")     _set_fancy(DBUS_SERVICES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/services"     "The kde dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)") +   _set_fancy(DBUS_SYSTEM_SERVICES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/system-services"     "The kde dbus system services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")  endif (WIN32)  # The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed. -# It should also be used when installing applications, since then  +# It should also be used when installing applications, since then  # on OS X application bundles will be installed to BUNDLE_INSTALL_DIR.  # The variable MUST NOT be used for installing plugins.  # It also MUST NOT be used for executables which are intended to go into sbin/ or libexec/. @@ -751,7 +796,7 @@ endif (WIN32)  # This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go  # into bin/.  # Later on it will be possible to extend this for installing OSX frameworks -# The COMPONENT Devel argument has the effect that static libraries belong to the  +# The COMPONENT Devel argument has the effect that static libraries belong to the  # "Devel" install component. If we use this also for all install() commands  # for header files, it will be possible to install  #   -everything: make install OR cmake -P cmake_install.cmake @@ -782,13 +827,13 @@ set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}  set(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}                                "${KDE4_BIN_INSTALL_DIR}" ) -set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}  +set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}                                "${KDE4_LIB_INSTALL_DIR}" )  # under Windows dlls may be also installed in bin/  if(WIN32) -  set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}  -                                "${_CMAKE_INSTALL_DIR}/bin"  +  set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} +                                "${_CMAKE_INSTALL_DIR}/bin"                                  "${CMAKE_INSTALL_PREFIX}/bin" )  endif(WIN32) @@ -810,8 +855,8 @@ if (WIN32)        message(FATAL_ERROR "Cygwin is NOT supported, use mingw or MSVC to build KDE4.")     endif(CYGWIN) -   # limit win32 packaging to kdelibs at now  -   # don't know if package name, version and notes are always available  +   # limit win32 packaging to kdelibs at now +   # don't know if package name, version and notes are always available     if(_kdeBootStrapping)        find_package(KDEWIN_Packager)        if (KDEWIN_PACKAGER_FOUND) @@ -861,7 +906,7 @@ if (WIN32)       set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}"         CACHE STATIC "MSVC IDE Run path" FORCE)     endif(MSVC_IDE) -    +     # we don't support anything below w2k and all winapi calls are unicodes     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0501 -DUNICODE" )  endif (WIN32) @@ -1003,7 +1048,7 @@ endif(MSVC)  if (CMAKE_COMPILER_IS_GNUCXX) -   set (KDE4_ENABLE_EXCEPTIONS -fexceptions) +   set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")     # Select flags.     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")     set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DQT_NO_DEBUG") @@ -1018,7 +1063,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)     if (CMAKE_SYSTEM_NAME MATCHES Linux)       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") -     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common") +     # As off Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions +     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")       add_definitions (-D_BSD_SOURCE)     endif (CMAKE_SYSTEM_NAME MATCHES Linux) @@ -1153,13 +1199,13 @@ macro (KDE4_PRINT_RESULTS)     # inside kdelibs the include dir and lib dir are internal, not "found"     if (NOT _kdeBootStrapping)         if(KDE4_INCLUDE_DIR) -          message(STATUS "Found KDE 4.3 include dir: ${KDE4_INCLUDE_DIR}") +          message(STATUS "Found KDE 4.4 include dir: ${KDE4_INCLUDE_DIR}")         else(KDE4_INCLUDE_DIR)            message(STATUS "ERROR: unable to find the KDE 4 headers")         endif(KDE4_INCLUDE_DIR)         if(KDE4_LIB_DIR) -          message(STATUS "Found KDE 4.3 library dir: ${KDE4_LIB_DIR}") +          message(STATUS "Found KDE 4.4 library dir: ${KDE4_LIB_DIR}")         else(KDE4_LIB_DIR)            message(STATUS "ERROR: unable to find the KDE 4 core library")         endif(KDE4_LIB_DIR) @@ -1204,7 +1250,7 @@ set(KDE4_INCLUDES     ${KDE4_INCLUDE_DIR}/KDE     ${KDE4_PHONON_INCLUDES}     ${QT_INCLUDES} -   ${_KDE4_PLATFORM_INCLUDE_DIRS}  +   ${_KDE4_PLATFORM_INCLUDE_DIRS}  )  set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS ) diff --git a/modules/FindKDEWin.cmake b/modules/FindKDEWin.cmake index 354ecb91..2c420b55 100644 --- a/modules/FindKDEWin.cmake +++ b/modules/FindKDEWin.cmake @@ -14,9 +14,10 @@  if (WIN32) -  if (NOT KDEWIN_LIBRARIES) +  if (NOT KDEWIN_LIBRARY)      find_path(KDEWIN_INCLUDE_DIR kdewin_export.h +      ${KDE4_INCLUDE_DIR}        ${CMAKE_INCLUDE_PATH}        ${CMAKE_INSTALL_PREFIX}/include      ) @@ -24,50 +25,54 @@ if (WIN32)      # search for kdewin in the default install directory for applications (default of (n)make install)      FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_PATH}" _cmakeLibraryPathCmakeStyle) -    if (CMAKE_BUILD_TYPE STREQUAL "Debug") +    string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) +    if (CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug")          set (LIBRARY_NAME kdewind) -    else (CMAKE_BUILD_TYPE STREQUAL "Debug") +    else(CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug")          set (LIBRARY_NAME kdewin) -    endif (CMAKE_BUILD_TYPE STREQUAL "Debug") +    endif (CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug") +    if (MSVC_IDE ) +        set (LIBRARY_NAME "kdewind") +    endif (MSVC_IDE)      find_library(KDEWIN_LIBRARY        NAMES ${LIBRARY_NAME}        PATHS  +        ${KDE4_LIB_DIR}          ${_cmakeLibraryPathCmakeStyle}          ${CMAKE_INSTALL_PREFIX}/lib        NO_SYSTEM_ENVIRONMENT_PATH      ) +  endif (NOT KDEWIN_LIBRARY) -    if (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) -      set(KDEWIN_FOUND TRUE) -      # add needed system libs -      set(KDEWIN_LIBRARIES ${KDEWIN_LIBRARY} user32 shell32 ws2_32 netapi32 userenv) -   -      if (MINGW) -        #mingw compiler -        set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/mingw ${QT_INCLUDES}) -      else (MINGW) -        # msvc compiler -        # add the MS SDK include directory if available -        file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR) -        set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/msvc  ${QT_INCLUDES} ${MSSDK_DIR}) -      endif (MINGW) -   -    endif (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) -    # required for configure -    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN_INCLUDES}) -    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${KDEWIN_LIBRARIES})       +  if (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) +    set(KDEWIN_FOUND TRUE) +    # add needed system libs +    set(KDEWIN_LIBRARIES ${KDEWIN_LIBRARY} user32 shell32 ws2_32 netapi32 userenv) -  endif (NOT KDEWIN_LIBRARIES) +    if (MINGW) +      #mingw compiler +      set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/mingw ${QT_INCLUDES}) +    else (MINGW) +      # msvc compiler +      # add the MS SDK include directory if available +      file(TO_CMAKE_PATH "$ENV{MSSDK}" MSSDK_DIR) +      set(KDEWIN_INCLUDES ${KDEWIN_INCLUDE_DIR} ${KDEWIN_INCLUDE_DIR}/msvc  ${QT_INCLUDES} ${MSSDK_DIR}) +    endif (MINGW) + +  endif (KDEWIN_LIBRARY AND KDEWIN_INCLUDE_DIR) +  # required for configure +  set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN_INCLUDES}) +  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${KDEWIN_LIBRARIES})          if (KDEWIN_FOUND) -    if (NOT KDEWIN_FIND_QUIETLY) -      message(STATUS "Found KDEWIN library: ${KDEWIN_LIBRARY}") -    endif (NOT KDEWIN_FIND_QUIETLY) +    if (NOT KDEWin_FIND_QUIETLY) +      message(STATUS "Found KDEWin library: ${KDEWIN_LIBRARY}") +    endif (NOT KDEWin_FIND_QUIETLY)    else (KDEWIN_FOUND) -    if (KDEWIN_FIND_REQUIRED) -      message(FATAL_ERROR "Could NOT find KDEWIN library\nPlease install it first") -    endif (KDEWIN_FIND_REQUIRED) +    if (KDEWin_FIND_REQUIRED) +      message(FATAL_ERROR "Could NOT find KDEWin library\nPlease install it first") +    endif (KDEWin_FIND_REQUIRED)    endif (KDEWIN_FOUND)  endif (WIN32) diff --git a/modules/FindLCMS.cmake b/modules/FindLCMS.cmake index cbb6b179..2b1f3cd7 100644 --- a/modules/FindLCMS.cmake +++ b/modules/FindLCMS.cmake @@ -8,6 +8,7 @@  # Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com> +# Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>  #  # Redistribution and use is allowed according to the terms of the BSD license.  # For details see the accompanying COPYING-CMAKE-SCRIPTS file. @@ -17,7 +18,7 @@  # in the FIND_PATH() and FIND_LIBRARY() calls  if(NOT WIN32)     find_package(PkgConfig) -   pkg_check_modules(PC_LCMS QUIET lcms) +   pkg_check_modules(PC_LCMS lcms)     set(LCMS_DEFINITIONS ${PC_LCMS_CFLAGS_OTHER})  endif(NOT WIN32) @@ -42,34 +43,21 @@ else(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES)  endif(LCMS_INCLUDE_DIR AND LCMS_LIBRARIES)  if(LCMS_FOUND) -   set(FIND_LCMS_VERSION_SOURCE -      "#include <lcms.h>\n int main()\n {\n return LCMS_VERSION;\n }\n") -   set(FIND_LCMS_VERSION_SOURCE_FILE ${CMAKE_BINARY_DIR}/CMakeTmp/FindLCMS.cxx) -   file(WRITE "${FIND_LCMS_VERSION_SOURCE_FILE}" "${FIND_LCMS_VERSION_SOURCE}") - -   set(FIND_LCMS_VERSION_ADD_INCLUDES  -      "-DINCLUDE_DIRECTORIES:STRING=${LCMS_INCLUDE_DIR}") - -   try_run(LCMS_VERSION LCMS_COMPILE_RESULT -      ${CMAKE_BINARY_DIR} -      ${FIND_LCMS_VERSION_SOURCE_FILE} -      CMAKE_FLAGS "${FIND_LCMS_VERSION_ADD_INCLUDES}" -      OUTPUT_VARIABLE OUTPUT) - -   if(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) +   file(READ ${LCMS_INCLUDE_DIR}/lcms.h LCMS_VERSION_CONTENT) +   string(REGEX MATCH "#define LCMS_VERSION[ ]*[0-9]*\n" LCMS_VERSION_MATCH ${LCMS_VERSION_CONTENT}) +   if(LCMS_VERSION_MATCH) +      string(REGEX REPLACE "#define LCMS_VERSION[ ]*([0-9]*)\n" "\\1" LCMS_VERSION ${LCMS_VERSION_MATCH})        if(NOT LCMS_FIND_QUIETLY)           string(SUBSTRING ${LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION)           string(SUBSTRING ${LCMS_VERSION} 1 2 LCMS_MINOR_VERSION)           message(STATUS "Found lcms version ${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}, ${LCMS_LIBRARIES}")        endif(NOT LCMS_FIND_QUIETLY) -   else(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) +   else(LCMS_VERSION_MATCH)        if(NOT LCMS_FIND_QUIETLY)           message(STATUS "Found lcms but failed to find version ${LCMS_LIBRARIES}") -         file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log -            "Find lcms version failed with the following output:\n${OUTPUT}\nFindLCMS.cxx:\n${FIND_LCMS_VERSION_SOURCE}\n\n")        endif(NOT LCMS_FIND_QUIETLY)        set(LCMS_VERSION NOTFOUND) -   endif(LCMS_COMPILE_RESULT AND NOT LCMS_VERSION STREQUAL FAILED_TO_RUN) +   endif(LCMS_VERSION_MATCH)  else(LCMS_FOUND)     if(NOT LCMS_FIND_QUIETLY)        if(LCMS_FIND_REQUIRED) diff --git a/modules/FindMySQL.cmake b/modules/FindMySQL.cmake index 6a0f8941..78332714 100644 --- a/modules/FindMySQL.cmake +++ b/modules/FindMySQL.cmake @@ -38,18 +38,20 @@ else(WIN32)  endif(WIN32)  if(WIN32) +   string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) +     # path suffix for debug/release mode     # binary_dist: mysql binary distribution     # build_dist: custom build -   if(CMAKE_BUILD_TYPE STREQUAL "Debug") +   if(CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug")        set(binary_dist debug)        set(build_dist Debug) -   else(CMAKE_BUILD_TYPE STREQUAL "Debug") +   else(CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug")        ADD_DEFINITIONS(-DDBUG_OFF)        set(binary_dist opt)        set(build_dist Release) -   endif(CMAKE_BUILD_TYPE STREQUAL "Debug") -    +   endif(CMAKE_BUILD_TYPE_TOLOWER STREQUAL "debug") +  #   find_library(MYSQL_LIBRARIES NAMES mysqlclient     find_library(MYSQL_LIBRARIES NAMES libmysql        PATHS diff --git a/modules/FindPolkitQt.cmake b/modules/FindPolkitQt.cmake new file mode 100644 index 00000000..8f52b10f --- /dev/null +++ b/modules/FindPolkitQt.cmake @@ -0,0 +1,70 @@ +# - Try to find Polkit-qt +# Once done this will define +# +#  POLKITQT_FOUND - system has Polkit-qt +#  POLKITQT_INCLUDE_DIR - the Polkit-qt include directory +#  POLKITQT_LIBRARIES - Link these to use all Polkit-qt libs +#  POLKITQT_CORE_LIBRARY - Link this to use the polkit-qt-core library only +#  POLKITQT_GUI_LIBRARY - Link this to use GUI elements in polkit-qt (polkit-qt-gui) +#  POLKITQT_DEFINITIONS - Compiler switches required for using Polkit-qt + +# Copyright (c) 2009, Daniel Nicoletti, <dantti85-pk@yahoo.com.br> +# Copyright (c) 2009, Dario Freddi, <drf54321@gmail.com> +# Copyright (c) 2009, Michal Malek, <michalm@jabster.pl> +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (POLKITQT_INCLUDE_DIR AND POLKITQT_LIB) +    set(POLKITQT_FIND_QUIETLY TRUE) +endif (POLKITQT_INCLUDE_DIR AND POLKITQT_LIB) + +if (NOT POLKITQT_MIN_VERSION) +  set(POLKITQT_MIN_VERSION "0.9.0") +endif (NOT POLKITQT_MIN_VERSION) + +if (NOT WIN32) +   # use pkg-config to get the directories and then use these values +   # in the FIND_PATH() and FIND_LIBRARY() calls +   find_package(PkgConfig) +   pkg_check_modules(PC_POLKITQT QUIET polkit-qt) +   set(POLKITQT_DEFINITIONS ${PC_POLKITQT_CFLAGS_OTHER}) +endif (NOT WIN32) + +find_path( POLKITQT_INCLUDE_DIR +     NAMES polkit-qt/auth.h +     PATH_SUFFIXES PolicyKit +) +find_library( POLKITQT_CORE_LIBRARY  +    NAMES polkit-qt-core  +    HINTS ${PC_POLKITQT_LIBDIR} +) +find_library( POLKITQT_GUI_LIBRARY  +    NAMES polkit-qt-gui  +    HINTS ${PC_POLKITQT_LIBDIR} +) +set(POLKITQT_LIBRARIES ${POLKITQT_GUI_LIBRARY} ${POLKITQT_CORE_LIBRARY}) + +include(FindPackageHandleStandardArgs) + +# handle the QUIETLY and REQUIRED arguments and set POLKITQT_FOUND to TRUE if  +# all listed variables are TRUE +find_package_handle_standard_args(PolkitQt DEFAULT_MSG POLKITQT_LIBRARIES POLKITQT_INCLUDE_DIR) + +mark_as_advanced(POLKITQT_INCLUDE_DIR POLKITQT_CORE_LIBRARY POLKITQT_GUI_LIBRARY POLKITQT_LIBRARIES) + +if (POLKITQT_FOUND) +    if (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) +        message(STATUS "Found Polkit-Qt release < ${POLKITQT_MIN_VERSION}") +        message(STATUS "You need Polkit-Qt version ${POLKITQT_MIN_VERSION} or newer to compile this component") +        set(POLKITQT_FOUND FALSE) +        return() +    else (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) +        if ( NOT PC_POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX ) +            message("WARNING: Installation prefix does not match PolicyKit install prefixes. You probably will need to move files installed " +                    "in POLICY_FILES_INSTALL_DIR and by dbus_add_activation_system_service to the ${PC_POLKITQT_PREFIX} prefix") +        endif (NOT PC_POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX) +    endif (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) +endif (POLKITQT_FOUND) + +set(POLKITQT_POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/PolicyKit/policy/) diff --git a/modules/FindQt4.cmake b/modules/FindQt4.cmake index df2c006e..7c79edeb 100644 --- a/modules/FindQt4.cmake +++ b/modules/FindQt4.cmake @@ -727,7 +727,7 @@ IF (QT4_QMAKE_FOUND)      PATHS      ${QT_INCLUDE_DIR}/QtWebKit      ${QT_HEADERS_DIR}/QtWebKit -    ${QT_LIBRARY_DIR}/QtWebkit.framework/Headers +    ${QT_LIBRARY_DIR}/QtWebKit.framework/Headers      NO_DEFAULT_PATH      ) @@ -1337,7 +1337,7 @@ IF (QT4_QMAKE_FOUND)      ENDIF (_customName)      ADD_CUSTOM_COMMAND(OUTPUT ${_target} -        COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} > ${_target} +        COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}          DEPENDS ${_in_file}      )    ENDMACRO(QT4_GENERATE_DBUS_INTERFACE) diff --git a/modules/FindSasl2.cmake b/modules/FindSasl2.cmake index 855266fc..787b578c 100644 --- a/modules/FindSasl2.cmake +++ b/modules/FindSasl2.cmake @@ -19,7 +19,9 @@ endif (SASL2_INCLUDE_DIR)  FIND_PATH(SASL2_INCLUDE_DIR sasl/sasl.h  ) -FIND_LIBRARY(SASL2_LIBRARIES NAMES sasl2 +# libsasl2 add for windows, because the windows package of cyrus-sasl2 +# contains a libsasl2 also for msvc which is not standard conform +FIND_LIBRARY(SASL2_LIBRARIES NAMES sasl2 libsasl2  )  include(FindPackageHandleStandardArgs) diff --git a/modules/FindSharedMimeInfo.cmake b/modules/FindSharedMimeInfo.cmake index 707cb006..9b076a30 100644 --- a/modules/FindSharedMimeInfo.cmake +++ b/modules/FindSharedMimeInfo.cmake @@ -70,7 +70,7 @@ set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")  if (NOT DESTDIR_VALUE)    # under Windows relative paths are used, that's why it runs from CMAKE_INSTALL_PREFIX    execute_process(COMMAND ${UPDATE_MIME_DATABASE_EXECUTABLE} ${_xdgmimeDir} -                  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}) +                  WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\")  endif (NOT DESTDIR_VALUE)  ")  endmacro (UPDATE_XDG_MIMETYPES) diff --git a/modules/FindSoprano.cmake b/modules/FindSoprano.cmake index 65c22561..29331cf9 100644 --- a/modules/FindSoprano.cmake +++ b/modules/FindSoprano.cmake @@ -173,16 +173,22 @@        set(SOPRANO_PLUGIN_VIRTUOSOBACKEND_FOUND TRUE)        set(_plugins "${_plugins} virtuosobackend")      endif(EXISTS ${SOPRANO_PLUGIN_DIR}/virtuosobackend.desktop) -     +      # make sure the Soprano cmake macros are found +    # We also include it directly for convinience      get_filename_component(_SOPRANO_PREFIX ${SOPRANO_INCLUDE_DIR} PATH)      find_file(_SOPRANO_MACRO_FILE NAMES SopranoAddOntology.cmake HINTS ${_SOPRANO_PREFIX}/share/soprano/cmake )      if(_SOPRANO_MACRO_FILE)        # new Soprano > 2.3.0 location +      include(${_SOPRANO_MACRO_FILE})        set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_SOPRANO_PREFIX}/share/soprano/cmake)      else(_SOPRANO_MACRO_FILE)        # the old Soprano 2.3.0 location -      set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_SOPRANO_PREFIX}/share/apps/cmake/modules) +      find_file(_SOPRANO_MACRO_FILE_OLD NAMES SopranoAddOntology.cmake HINTS ${_SOPRANO_PREFIX}/share/apps/cmake/modules ) +      if(_SOPRANO_MACRO_FILE_OLD) +        include(${_SOPRANO_MACRO_FILE_OLD}) +        set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_SOPRANO_PREFIX}/share/apps/cmake/modules) +      endif(_SOPRANO_MACRO_FILE_OLD)      endif(_SOPRANO_MACRO_FILE)    endif(Soprano_FOUND) @@ -219,6 +225,8 @@ mark_as_advanced(SOPRANO_CLIENT_LIBRARIES                   SOPRANO_LIBRARIES                   SOPRANO_SERVER_LIBRARIES                   SOPRANO_INCLUDE_DIR -                 SOPRANO_PLUGIN_DIR) +                 SOPRANO_PLUGIN_DIR +                 _SOPRANO_MACRO_FILE +                 )  #endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES) diff --git a/modules/KDE4Defaults.cmake b/modules/KDE4Defaults.cmake index 1f2d07c0..bc27a2db 100644 --- a/modules/KDE4Defaults.cmake +++ b/modules/KDE4Defaults.cmake @@ -24,11 +24,11 @@ set(CMAKE_COLOR_MAKEFILE ON)  # define the generic version of the libraries here  # this makes it easy to advance it when the next KDE release comes  # Use this version number for libraries which are at version n in KDE version n -set(GENERIC_LIB_VERSION "4.3.0") +set(GENERIC_LIB_VERSION "4.4.0")  set(GENERIC_LIB_SOVERSION "4")  # Use this version number for libraries which are already at version n+1 in KDE version n -set(KDE_NON_GENERIC_LIB_VERSION "5.3.0") +set(KDE_NON_GENERIC_LIB_VERSION "5.4.0")  set(KDE_NON_GENERIC_LIB_SOVERSION "5")  # windows does not support LD_LIBRARY_PATH or similar diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index cf33ad35..4aa4236a 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -22,6 +22,8 @@  # KDE4_ADD_APP_ICON  # KDE4_CREATE_MANPAGE  # KDE4_CREATE_BASIC_CMAKE_VERSION_FILE (function) +# KDE4_INSTALL_AUTH_HELPER_FILES +# KDE4_AUTH_INSTALL_ACTIONS  # Copyright (c) 2006-2009 Alexander Neundorf, <neundorf@kde.org>  # Copyright (c) 2006, 2007, Laurent Montel, <montel@kde.org> @@ -53,16 +55,37 @@ endif(NOT COMMAND _AUTOMOC4_KDE4_PRE_TARGET_HANDLING)  macro (KDE4_ADD_KCFG_FILES _sources ) -   if( ${ARGV1} STREQUAL "GENERATE_MOC" ) -      set(_kcfg_generatemoc TRUE) -   endif( ${ARGV1} STREQUAL "GENERATE_MOC" ) +   foreach (_current_ARG ${ARGN}) +       if( ${_current_ARG} STREQUAL "GENERATE_MOC" ) +           set(_kcfg_generatemoc TRUE) +       endif( ${_current_ARG} STREQUAL "GENERATE_MOC" ) + +       if( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" ) +           set(_kcfg_relativepath TRUE) +       endif( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" ) +   endforeach (_current_ARG ${ARGN})     foreach (_current_FILE ${ARGN}) -     if(NOT ${_current_FILE} STREQUAL "GENERATE_MOC") +     if(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")         get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)         get_filename_component(_abs_PATH ${_tmp_FILE} PATH) + +       if (_kcfg_relativepath) # Process relative path only if the option was set +           # Get relative path +           get_filename_component(_rel_PATH ${_current_FILE} PATH) + +           if (IS_ABSOLUTE ${_rel_PATH}) +               # We got an absolute path +               set(_rel_PATH "") +           endif (IS_ABSOLUTE ${_rel_PATH}) +       endif (_kcfg_relativepath) +         get_filename_component(_basename ${_tmp_FILE} NAME_WE) +       # If we had a relative path and we're asked to use it, then change the basename accordingly +       if(NOT ${_rel_PATH} STREQUAL "") +           set(_basename ${_rel_PATH}/${_basename}) +       endif(NOT ${_rel_PATH} STREQUAL "")         file(READ ${_tmp_FILE} _contents)         string(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2"  _kcfg_FILENAME "${_contents}") @@ -78,10 +101,15 @@ macro (KDE4_ADD_KCFG_FILES _sources )             message(ERROR "${_kcfg_FILENAME} not found; tried in ${_abs_PATH} and ${CMAKE_CURRENT_BINARY_DIR}")         endif(NOT EXISTS "${_kcfg_FILE}") +       # make sure the directory exist in the build directory +       if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}") +           file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}) +       endif(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}") +         # the command for creating the source file from the kcfg file         add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}            COMMAND ${KDE4_KCFGC_EXECUTABLE} -          ARGS ${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR} +          ARGS ${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}            MAIN_DEPENDENCY ${_tmp_FILE}            DEPENDS ${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} ) @@ -92,7 +120,7 @@ macro (KDE4_ADD_KCFG_FILES _sources )         endif(_kcfg_generatemoc)         list(APPEND ${_sources} ${_src_FILE} ${_header_FILE}) -     endif(NOT ${_current_FILE} STREQUAL "GENERATE_MOC") +     endif(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")     endforeach (_current_FILE)  endmacro (KDE4_ADD_KCFG_FILES) @@ -496,10 +524,12 @@ endmacro (KDE4_CREATE_FINAL_FILES)  # If RPATH is not disabled, these scripts are also used but only for consistency, because  # they don't really influence anything then, because the compiled-in RPATH overrides  # the LD_LIBRARY_PATH env. variable. -macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME _type) +macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME)     if (UNIX)        if (APPLE)           set(_library_path_variable "DYLD_LIBRARY_PATH") +      elseif (CYGWIN) +         set(_library_path_variable "PATH")        else (APPLE)           set(_library_path_variable "LD_LIBRARY_PATH")        endif (APPLE) @@ -590,15 +620,14 @@ endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)  # if "NOGUI" is in the list of files, the _nogui argument is set to  # "NOGUI" (which evaluates to TRUE in cmake), otherwise it is set empty  # (which evaluates to FALSE in cmake) -# if "RUN_UNINSTALLED" is in the list of files, the _uninst argument is set to -# "RUN_UNINSTALLED" (which evaluates to TRUE in cmake), otherwise it is set empty -# (which evaluates to FALSE in cmake) +# "RUN_UNINSTALLED" in the list of files is ignored, it is not necessary anymore +# since KDE 4.2 (with cmake 2.6.2), since then all executables are always built +# with RPATH pointing into the build dir.  # if "TEST" is in the list of files, the _test argument is set to  # "TEST" (which evaluates to TRUE in cmake), otherwise it is set empty  # (which evaluates to FALSE in cmake) -macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test) +macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _test)     set(${_nogui}) -   set(${_uninst})     set(${_test})     set(${_output_LIST} ${ARGN})     list(LENGTH ${_output_LIST} count) @@ -618,7 +647,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test)     endif (${first_PARAM} STREQUAL "NOGUI")     if (${first_PARAM} STREQUAL "RUN_UNINSTALLED") -      set(${_uninst} "RUN_UNINSTALLED")        set(remove 0)     endif (${first_PARAM} STREQUAL "RUN_UNINSTALLED") @@ -633,7 +661,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test)     endif (${second_PARAM} STREQUAL "NOGUI")     if (${second_PARAM} STREQUAL "RUN_UNINSTALLED") -      set(${_uninst} "RUN_UNINSTALLED")        set(remove 0;1)     endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED") @@ -643,7 +670,6 @@ macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst _test)     endif (${second_PARAM} STREQUAL "TEST") -     if (NOT "${remove}" STREQUAL "NOTFOUND")        list(REMOVE_AT ${_output_LIST} ${remove})     endif (NOT "${remove}" STREQUAL "NOTFOUND") @@ -653,7 +679,7 @@ endmacro(KDE4_CHECK_EXECUTABLE_PARAMS)  macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME ) -   kde4_check_executable_params(_SRCS _nogui _uninst _test ${ARGN}) +   kde4_check_executable_params(_SRCS _nogui _test ${ARGN})     configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)     set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp PROPERTIES SKIP_AUTOMOC TRUE) @@ -679,10 +705,10 @@ macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )        if (KDE4_ENABLE_FINAL)           kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS}) -         kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}"  ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) +         kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})        else (KDE4_ENABLE_FINAL) -         kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile}) +         kde4_add_executable(${_target_NAME} "${_nogui}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})        endif (KDE4_ENABLE_FINAL)        set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) @@ -703,7 +729,7 @@ macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )        set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME}) -      kde4_add_executable(${_target_NAME} "${_nogui}" "${_uninst}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp) +      kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)        target_link_libraries(${_target_NAME} kdeinit_${_target_NAME})     endif(WIN32) @@ -847,10 +873,9 @@ endmacro(_KDE4_ADD_MANIFEST)  macro (KDE4_ADD_EXECUTABLE _target_NAME) -   kde4_check_executable_params( _SRCS _nogui _uninst _test ${ARGN}) +   kde4_check_executable_params( _SRCS _nogui _test ${ARGN})     set(_add_executable_param) -   set(_type "GUI")     # determine additional parameters for add_executable()     # for GUI apps, create a bundle on OSX @@ -864,14 +889,9 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME)     endif (WIN32)     if (_nogui) -      set(_type "NOGUI")        set(_add_executable_param)     endif (_nogui) -   if (_uninst OR _test) -      set(_type "RUN_UNINSTALLED ${_type}") -   endif (_uninst OR _test) -     if (_test AND NOT KDE4_BUILD_TESTS)        set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL)     endif (_test AND NOT KDE4_BUILD_TESTS) @@ -895,7 +915,7 @@ macro (KDE4_ADD_EXECUTABLE _target_NAME)        set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}/\\"")     endif (_test) -   kde4_handle_rpath_for_executable(${_target_NAME} ${_type}) +   kde4_handle_rpath_for_executable(${_target_NAME})     if (WIN32)        target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY}) @@ -1189,6 +1209,65 @@ macro (KDE4_HANDLE_RPATH_FOR_LIBRARY _target_NAME)     endif (NOT CMAKE_SKIP_RPATH)  endmacro (KDE4_HANDLE_RPATH_FOR_LIBRARY) +# This macro adds the needed files for an helper executable meant to be used by applications using KAuth. +# It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on. +# This macro takes care of generate the needed files, and install them in the right location. This boils down +# to a DBus policy to let the helper register on the system bus, and a service file for letting the helper +# being automatically activated by the system bus. +# *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work. +function(KDE4_INSTALL_AUTH_HELPER_FILES HELPER_TARGET HELPER_ID HELPER_USER) +     +  if (_kdeBootStrapping) +    set(_stubFilesDir  ${CMAKE_SOURCE_DIR}/kdecore/auth/backends/dbus/ ) +  else (_kdeBootStrapping) +    set(_stubFilesDir  ${KDE4_DATA_INSTALL_DIR}/kauth/ ) +  endif (_kdeBootStrapping) + +  configure_file(${_stubFilesDir}/dbus_policy.stub +                 ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf) +  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf  +          DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/) +        +  configure_file(${_stubFilesDir}/dbus_service.stub +                 ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service) +  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service  +          DESTINATION ${DBUS_SYSTEM_SERVICES_INSTALL_DIR}) +endfunction(KDE4_INSTALL_AUTH_HELPER_FILES) + +# This macro generates an action file, depending on the backend used, for applications using KAuth. +# It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example +# for file format). The macro will take care of generating the file according to the backend specified,  +# and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy +# file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/), +# and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during +# the install phase +function(KDE4_INSTALL_AUTH_ACTIONS HELPER_ID ACTIONS_FILE) + +  if(APPLE) +    install(CODE "execute_process(COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})") +  elseif(UNIX) +    set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy) +    get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE) +     +    add_custom_command(OUTPUT ${_output}  +                       COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${_input} > ${_output}  +                       MAIN_DEPENDENCY ${_input} +                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +                       COMMENT "Generating ${HELPER_ID}.policy" +                       DEPENDS ${_KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP}) +    add_custom_target("actions for ${HELPER_ID}" ALL DEPENDS ${_output}) + +    if (NOT POLKITQT_FOUND) +        macro_optional_find_package(PolkitQt) +    endif (NOT POLKITQT_FOUND) + +    if (POLKITQT_FOUND) +      install(FILES ${_output} DESTINATION ${POLKITQT_POLICY_FILES_INSTALL_DIR}) +    endif (POLKITQT_FOUND) +  endif() + +endfunction(KDE4_INSTALL_AUTH_ACTIONS) +  macro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES _append_or_write _filename)     message(FATAL_ERROR "_KDE4_EXPORT_LIBRARY_DEPENDENCIES() was an internal macro and has been removed again. Just remove the code which calls it, there is no substitute.") diff --git a/modules/MacroKAuth.cmake b/modules/MacroKAuth.cmake new file mode 100644 index 00000000..2bde63ce --- /dev/null +++ b/modules/MacroKAuth.cmake @@ -0,0 +1,3 @@ +message(FATAL_ERROR "Don't include(MacroKAuth) anymore, it's now included in find_package(KDE4). This file will be removed soon, and will not appear in KDE 4.4 release.") + + diff --git a/modules/SIPMacros.cmake b/modules/SIPMacros.cmake index eb5ea06c..6096ccb6 100644 --- a/modules/SIPMacros.cmake +++ b/modules/SIPMacros.cmake @@ -102,8 +102,12 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)          COMMAND ${SIP_EXECUTABLE} ${_sip_tags} ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip}          DEPENDS ${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND}      ) -     -    ADD_LIBRARY(${_logical_name} SHARED ${_sip_output_files} ) +    # not sure if type MODULE could be uses anywhere, limit to cygwin for now +    IF (CYGWIN) +        ADD_LIBRARY(${_logical_name} MODULE ${_sip_output_files} ) +    ELSE (CYGWIN) +        ADD_LIBRARY(${_logical_name} SHARED ${_sip_output_files} ) +    ENDIF (CYGWIN)      TARGET_LINK_LIBRARIES(${_logical_name} ${PYTHON_LIBRARY})      TARGET_LINK_LIBRARIES(${_logical_name} ${EXTRA_LINK_LIBRARIES})      SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name}) diff --git a/modules/kde4uic.cmake b/modules/kde4uic.cmake index 0e2a33c9..ed328b40 100644 --- a/modules/kde4uic.cmake +++ b/modules/kde4uic.cmake @@ -35,21 +35,22 @@ if (KDE4_HEADER)      -tr tr2i18n      ${KDE_UIC_FILE}      OUTPUT_VARIABLE _uic_CONTENTS -    ERROR_QUIET    )     set(KDE_UIC_CPP_FILE ${KDE_UIC_H_FILE})  endif (KDE4_HEADER) -#replace tr218n("") with QString::null to avoid warning from KLocale -STRING(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) -STRING(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) -#replace image15_data with img15_filename to make enable_final work -STRING(REGEX REPLACE "image([0-9]+)_data" "img\\1_${KDE_UIC_BASENAME}" _uic_CONTENTS "${_uic_CONTENTS}") -#fixup include guard -STRING(REGEX REPLACE "#ifndef " "#ifndef UI_" _uic_CONTENTS "${_uic_CONTENTS}") -STRING(REGEX REPLACE "#define " "#define UI_" _uic_CONTENTS "${_uic_CONTENTS}") +IF (_uic_CONTENTS) +  #replace tr218n("") with QString::null to avoid warning from KLocale +  STRING(REGEX REPLACE "tr2i18n\\(\"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) +  STRING(REGEX REPLACE "tr2i18n\\(\"\", \"\"\\)" "QString::null" _uic_CONTENTS "${_uic_CONTENTS}" ) +  #replace image15_data with img15_filename to make enable_final work +  STRING(REGEX REPLACE "image([0-9]+)_data" "img\\1_${KDE_UIC_BASENAME}" _uic_CONTENTS "${_uic_CONTENTS}") +  #fixup include guard +  STRING(REGEX REPLACE "#ifndef " "#ifndef UI_" _uic_CONTENTS "${_uic_CONTENTS}") +  STRING(REGEX REPLACE "#define " "#define UI_" _uic_CONTENTS "${_uic_CONTENTS}") -FILE(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n${_uic_CONTENTS}\n") +  FILE(WRITE ${KDE_UIC_CPP_FILE} "#include <kdialog.h>\n#include <klocale.h>\n\n${_uic_CONTENTS}\n") +ENDIF() | 
