Ticket #57332: kde4-workspace.2.diff

File kde4-workspace.2.diff, 98.8 KB (added by RJVB (René Bertin), 6 years ago)

port dir patch take 2

  • kde/kde4-workspace/Portfile

    diff --git a/kde/kde4-workspace/Portfile b/kde/kde4-workspace/Portfile
    index c78470e38d..36d01e4a41 100644
    a b PortGroup kde4 1.1 
    55
    66fetch.type          git
    77git.url             git://anongit.kde.org/kde-workspace
    8 git.branch          b904af16
     8git.branch          100800e799b062914fd2e6f517643effaca40ae7
    99
    1010name                kde4-workspace
    11 version             4.14.4.20150324
    12 revision            5
    13 set plasmaversion   4.11.17
     11version             4.14.4.20150831
     12set plasmaversion   4.11.22-6
    1413categories          kde kde4
    1514maintainers         {gmail.com:rjvbertin @RJVB}
    1615license             GPL-2+ LGPL-2.1+
    use_xz yes 
    2827#                    sha256  09d8ae1ac1b704fc919bdedfec47c6561033dca125b0096cb9ed398445fa942f
    2928
    3029patchfiles          patch-CMakeLists-for-OSX.patch \
    31                     patch-libs-CMakeLists.patch \
    3230                    patch-kcontrol.patch \
    33                     systemsettings-correct-menuplacement.patch
     31                    systemsettings-correct-menuplacement.patch \
     32                    patch-input-wheelzooms.diff
    3433
    3534depends_build-append port:boost \
    3635                    port:freetype \
    3736                    port:libusb
    3837
    3938depends_lib-append  port:kdelibs4 \
    40                     port:kdepimlibs4 \
     39                    path:lib/libakonadi-calendar.4.dylib:kdepimlibs4 \
    4140                    port:kactivities \
    4241                    port:nepomuk-core \
    4342                    port:libqalculate \
    4443                    port:qjson \
    4544                    port:qimageblitz
    4645
    47 configure.args-append  -DBUILD_webkit:BOOL=ON
     46configure.args-append \
     47                    -DBUILD_webkit:BOOL=ON \
     48                    -DBUILD_OXYGEN=ON
    4849
    4950configure.args-delete -DCMAKE_BUILD_TYPE=Release
    5051configure.args-append -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_STRIP:FILEPATH=/bin/echo
    5152
    52 variant oxygen description {Build the Oxygen theme} {
    53     patchfiles-append     no-oxygen-theme.patch
     53variant oxygen description {Build the Oxygen theme} {}
     54default_variants    +oxygen
     55
     56if {![variant_isset oxygen]} {
     57    configure.args-replace \
     58                    -DBUILD_OXYGEN=ON \
     59                    -DBUILD_OXYGEN=OFF
    5460}
    5561
    56 default_variants    +oxygen
     62# maintainer convience: let the build go as far as possible to collect as
     63# many errors as possible (if any) in a single pass.
     64build.post_args-append \
     65                    -k
     66
     67if {${os.major} >= 18} {
     68    # 10.14 "Mojave" seems to get confused about symbol visibility in this port, so turn
     69    # off selective visibility and make all symbols public.
     70    post-extract {
     71        xinstall -m 755 ${filespath}/FindKDE4Internal.cmake ${worksrcpath}/cmake/modules/
     72        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/cmake/modules/FindKDE4Internal.cmake
     73    }
     74}
    5775
    5876post-destroot {
    5977    ln -s ${applications_dir}/KDE4/plasma-windowed.app/Contents/MacOS/plasma-windowed ${destroot}${prefix}/bin/plasma-windowed
  • new file kde/kde4-workspace/files/FindKDE4Internal.cmake

    diff --git a/kde/kde4-workspace/files/FindKDE4Internal.cmake b/kde/kde4-workspace/files/FindKDE4Internal.cmake
    new file mode 100644
    index 0000000000..601e172785
    - +  
     1# - Find the KDE4 include and library dirs, KDE preprocessors and define a some macros
     2#
     3# This module defines the following variables:
     4#
     5#  KDE4_FOUND               - set to TRUE if everything required for building KDE software has been found
     6#
     7#  KDE4_DEFINITIONS         - compiler definitions required for compiling KDE software
     8#  KDE4_INCLUDE_DIR         - the KDE 4 include directory
     9#  KDE4_INCLUDES            - all include directories required for KDE, i.e.
     10#                             KDE4_INCLUDE_DIR, but also the Qt4 include directories
     11#                             and other platform specific include directories
     12#  KDE4_LIB_DIR             - the directory where the KDE libraries are installed,
     13#                             intended to be used with LINK_DIRECTORIES(). In general, this is not necessary.
     14#  KDE4_LIBEXEC_INSTALL_DIR - the directory where libexec executables from kdelibs are installed
     15#  KDE4_BIN_INSTALL_DIR     - the directory where executables from kdelibs are installed
     16#  KDE4_SBIN_INSTALL_DIR    - the directory where system executables from kdelibs are installed
     17#  KDE4_DATA_INSTALL_DIR    - the parent directory where kdelibs applications install their data
     18#  KDE4_HTML_INSTALL_DIR    - the directory where HTML documentation from kdelibs is installed
     19#  KDE4_CONFIG_INSTALL_DIR  - the directory where config files from kdelibs are installed
     20#  KDE4_ICON_INSTALL_DIR    - the directory where icons from kdelibs are
     21#  KDE4_IMPORTS_INSTALL_DIR - the directory where imports from kdelibs are
     22#  KDE4_KCFG_INSTALL_DIR    - the directory where kconfig files from kdelibs are installed
     23#  KDE4_LOCALE_INSTALL_DIR  - the directory where translations from kdelibs are installed
     24#  KDE4_MIME_INSTALL_DIR    - the directory where mimetype desktop files from kdelibs are installed
     25#  KDE4_SOUND_INSTALL_DIR   - the directory where sound files from kdelibs are installed
     26#  KDE4_TEMPLATES_INSTALL_DIR     - the directory where templates (Create new file...) from kdelibs are installed
     27#  KDE4_WALLPAPER_INSTALL_DIR     - the directory where wallpapers from kdelibs are installed
     28#  KDE4_KCONF_UPDATE_INSTALL_DIR  - the directory where kconf_update files from kdelibs are installed
     29#  KDE4_AUTOSTART_INSTALL_DIR     - the directory where autostart from kdelibs are installed
     30#  KDE4_XDG_APPS_INSTALL_DIR      - the XDG apps dir from kdelibs
     31#  KDE4_XDG_DIRECTORY_INSTALL_DIR - the XDG directory from kdelibs
     32#  KDE4_SYSCONF_INSTALL_DIR       - the directory where sysconfig files from kdelibs are installed
     33#  KDE4_MAN_INSTALL_DIR           - the directory where man pages from kdelibs are installed
     34#  KDE4_INFO_INSTALL_DIR          - the directory where info files from kdelibs are installed
     35#  KDE4_DBUS_INTERFACES_DIR       - the directory where dbus interfaces from kdelibs are installed
     36#  KDE4_DBUS_SERVICES_DIR         - the directory where dbus service files from kdelibs are installed
     37#
     38# The following variables are defined for the various tools required to
     39# compile KDE software:
     40#
     41#  KDE4_KCFGC_EXECUTABLE    - the kconfig_compiler executable
     42#  KDE4_AUTOMOC_EXECUTABLE  - the kde4automoc executable, deprecated, use AUTOMOC4_EXECUTABLE instead
     43#  KDE4_MEINPROC_EXECUTABLE - the meinproc4 executable
     44#  KDE4_MAKEKDEWIDGETS_EXECUTABLE - the makekdewidgets executable
     45#
     46# The following variables point to the location of the KDE libraries,
     47# but shouldn't be used directly:
     48#
     49#  KDE4_KDECORE_LIBRARY     - the kdecore library
     50#  KDE4_KDEUI_LIBRARY       - the kdeui library
     51#  KDE4_KIO_LIBRARY         - the kio library
     52#  KDE4_KPARTS_LIBRARY      - the kparts library
     53#  KDE4_KUTILS_LIBRARY      - the kutils library
     54#  KDE4_KEMOTICONS_LIBRARY  - the kemoticons library
     55#  KDE4_KIDLETIME_LIBRARY   - the kidletime library
     56#  KDE4_KCMUTILS_LIBRARY    - the kcmutils library
     57#  KDE4_KPRINTUTILS_LIBRARY - the kprintutils library
     58#  KDE4_KDE3SUPPORT_LIBRARY - the kde3support library
     59#  KDE4_KFILE_LIBRARY       - the kfile library
     60#  KDE4_KHTML_LIBRARY       - the khtml library
     61#  KDE4_KJS_LIBRARY         - the kjs library
     62#  KDE4_KJSAPI_LIBRARY      - the kjs public api library
     63#  KDE4_KNEWSTUFF2_LIBRARY  - the knewstuff2 library
     64#  KDE4_KNEWSTUFF3_LIBRARY  - the knewstuff3 library
     65#  KDE4_KDNSSD_LIBRARY      - the kdnssd library
     66#  KDE4_PHONON_LIBRARY      - the phonon library
     67#  KDE4_THREADWEAVER_LIBRARY- the threadweaver library
     68#  KDE4_SOLID_LIBRARY       - the solid library
     69#  KDE4_KNOTIFYCONFIG_LIBRARY- the knotifyconfig library
     70#  KDE4_KROSSCORE_LIBRARY   - the krosscore library
     71#  KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library
     72#  KDE4_NEPOMUK_LIBRARY     - the nepomuk library
     73#  KDE4_PLASMA_LIBRARY      - the plasma library
     74#  KDE4_KUNITCONVERSION_LIBRARY - the kunitconversion library
     75#  KDE4_KDEWEBKIT_LIBRARY   - the kdewebkit library
     76#
     77#  KDE4_PLASMA_OPENGL_FOUND  - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise
     78#
     79# Compared to the variables above, the following variables
     80# also contain all of the depending libraries, so the variables below
     81# should be used instead of the ones above:
     82#
     83#  KDE4_KDECORE_LIBS          - the kdecore library and all depending libraries
     84#  KDE4_KDEUI_LIBS            - the kdeui library and all depending libraries
     85#  KDE4_KIO_LIBS              - the kio library and all depending libraries
     86#  KDE4_KPARTS_LIBS           - the kparts library and all depending libraries
     87#  KDE4_KUTILS_LIBS           - the kutils library and all depending libraries
     88#  KDE4_KEMOTICONS_LIBS       - the kemoticons library and all depending libraries
     89#  KDE4_KIDLETIME_LIBS        - the kidletime library and all depending libraries
     90#  KDE4_KCMUTILS_LIBS         - the kcmutils library and all depending libraries
     91#  KDE4_KPRINTUTILS_LIBS      - the kprintutils library and all depending libraries
     92#  KDE4_KDE3SUPPORT_LIBS      - the kde3support library and all depending libraries
     93#  KDE4_KFILE_LIBS            - the kfile library and all depending libraries
     94#  KDE4_KHTML_LIBS            - the khtml library and all depending libraries
     95#  KDE4_KJS_LIBS              - the kjs library and all depending libraries
     96#  KDE4_KJSAPI_LIBS           - the kjs public api library and all depending libraries
     97#  KDE4_KNEWSTUFF2_LIBS       - the knewstuff2 library and all depending libraries
     98#  KDE4_KNEWSTUFF3_LIBS       - the knewstuff3 library and all depending libraries
     99#  KDE4_KDNSSD_LIBS           - the kdnssd library and all depending libraries
     100#  KDE4_KDESU_LIBS            - the kdesu library and all depending libraries
     101#  KDE4_KPTY_LIBS             - the kpty library and all depending libraries
     102#  KDE4_PHONON_LIBS           - the phonon library and all depending librairies
     103#  KDE4_THREADWEAVER_LIBRARIES- the threadweaver library and all depending libraries
     104#  KDE4_SOLID_LIBS            - the solid library and all depending libraries
     105#  KDE4_KNOTIFYCONFIG_LIBS    - the knotify config library and all depending libraries
     106#  KDE4_KROSSCORE_LIBS        - the kross core library and all depending libraries
     107#  KDE4_KROSSUI_LIBS          - the kross ui library which includes core and all depending libraries
     108#  KDE4_KTEXTEDITOR_LIBS      - the ktexteditor library and all depending libraries
     109#  KDE4_NEPOMUK_LIBS          - the nepomuk library and all depending libraries
     110#  KDE4_PLASMA_LIBS           - the plasma library and all depending librairies
     111#  KDE4_KUNITCONVERSION_LIBS  - the kunitconversion library and all depending libraries
     112#  KDE4_KDEWEBKIT_LIBS        - the kdewebkit library and all depending libraries
     113#
     114# This module defines also a bunch of variables used as locations for install directories
     115# for files of the package which is using this module. These variables don't say
     116# anything about the location of the installed KDE.
     117# They can be relative (to CMAKE_INSTALL_PREFIX) or absolute.
     118# Under Windows they are always relative.
     119#
     120#  BIN_INSTALL_DIR          - the directory where executables will be installed (default is prefix/bin)
     121#  BUNDLE_INSTALL_DIR       - Mac only: the directory where application bundles will be installed (default is /Applications/KDE4 )
     122#  SBIN_INSTALL_DIR         - the directory where system executables will be installed (default is prefix/sbin)
     123#  LIB_INSTALL_DIR          - the directory where libraries will be installed (default is prefix/lib)
     124#  CONFIG_INSTALL_DIR       - the directory where config files will be installed
     125#  DATA_INSTALL_DIR         - the parent directory where applications can install their data
     126#  HTML_INSTALL_DIR         - the directory where HTML documentation will be installed
     127#  ICON_INSTALL_DIR         - the directory where the icons will be installed (default prefix/share/icons/)
     128#  INFO_INSTALL_DIR         - the directory where info files will be installed (default prefix/info)
     129#  KCFG_INSTALL_DIR         - the directory where kconfig files will be installed
     130#  LOCALE_INSTALL_DIR       - the directory where translations will be installed
     131#  MAN_INSTALL_DIR          - the directory where man pages will be installed (default prefix/man/)
     132#  MIME_INSTALL_DIR         - the directory where mimetype desktop files will be installed
     133#  PLUGIN_INSTALL_DIR       - the subdirectory relative to the install prefix where plugins will be installed (default is ${KDE4_LIB_INSTALL_DIR}/kde4)
     134#  IMPORTS_INSTALL_DIR      - the subdirectory relative to the install prefix where imports will be installed
     135#  SERVICES_INSTALL_DIR     - the directory where service (desktop, protocol, ...) files will be installed
     136#  SERVICETYPES_INSTALL_DIR - the directory where servicestypes desktop files will be installed
     137#  SOUND_INSTALL_DIR        - the directory where sound files will be installed
     138#  TEMPLATES_INSTALL_DIR    - the directory where templates (Create new file...) will be installed
     139#  WALLPAPER_INSTALL_DIR    - the directory where wallpapers will be installed
     140#  AUTOSTART_INSTALL_DIR    - the directory where autostart files will be installed
     141#  DEMO_INSTALL_DIR         - the directory where demos will be installed
     142#  KCONF_UPDATE_INSTALL_DIR - the directory where kconf_update files will be installed
     143#  SYSCONF_INSTALL_DIR      - the directory where sysconfig files will be installed (default /etc)
     144#  XDG_APPS_INSTALL_DIR     - the XDG apps dir
     145#  XDG_DIRECTORY_INSTALL_DIR- the XDG directory
     146#  XDG_MIME_INSTALL_DIR     - the XDG mimetypes install dir
     147#  DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces will be installed (default is prefix/share/dbus-1/interfaces)
     148#  DBUS_SERVICES_INSTALL_DIR        - the directory where dbus services will be installed (default is prefix/share/dbus-1/services )
     149#  DBUS_SYSTEM_SERVICES_INSTALL_DIR        - the directory where dbus system services will be installed (default is prefix/share/dbus-1/system-services )
     150#
     151# The variable INSTALL_TARGETS_DEFAULT_ARGS can be used when installing libraries
     152# or executables into the default locations.
     153# The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed.
     154# It should also be used when installing applications, since then
     155# on OS X application bundles will be installed to BUNDLE_INSTALL_DIR.
     156# The variable MUST NOT be used for installing plugins.
     157# It also MUST NOT be used for executables which are intended to go into sbin/ or libexec/.
     158#
     159# Usage is like this:
     160#    install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} )
     161#
     162# This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go
     163# into bin/.
     164#
     165#
     166# The following variable is provided, but seem to be unused:
     167#  LIBS_HTML_INSTALL_DIR    /share/doc/HTML            CACHE STRING "Is this still used ?")
     168#
     169# The following user adjustable options are provided:
     170#
     171#  KDE4_ENABLE_FINAL - enable KDE-style enable-final all-in-one-compilation
     172#  KDE4_BUILD_TESTS  - enable this to build the testcases
     173#  KDE4_ENABLE_FPIE  - enable it to use gcc Position Independent Executables feature
     174#  KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE
     175#                      If enabled, the package should install its <package>Config.cmake file to
     176#                      lib/cmake/<package>/ instead to lib/<package>/cmake
     177#  KDE4_SERIALIZE_TOOL - wrapper to serialize potentially resource-intensive commands during
     178#                      parallel builds (set to 'icecc' when using icecream)
     179#
     180# It also adds the following macros and functions (from KDE4Macros.cmake)
     181#  KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui)
     182#    Use this to add Qt designer ui files to your application/library.
     183#
     184#  KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui)
     185#    Use this to add Qt designer ui files from Qt version 3 to your application/library.
     186#
     187#  KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc)
     188#    Use this to add KDE config compiler files to your application/library.
     189#    Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files.
     190#    Use optional USE_RELATIVE_PATH to generate the classes in the build following the given
     191#    relative path to the file.
     192#
     193#  KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets)
     194#    Use this to add widget description files for the makekdewidgets code generator
     195#    for Qt Designer plugins.
     196#
     197#  KDE4_CREATE_FINAL_FILES (filename_CXX filename_C file1 ... fileN)
     198#    This macro is intended mainly for internal uses.
     199#    It is used for enable-final. It will generate two source files,
     200#    one for the C files and one for the C++ files.
     201#    These files will have the names given in filename_CXX and filename_C.
     202#
     203#  KDE4_ADD_PLUGIN ( name [WITH_PREFIX] file1 ... fileN )
     204#    Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
     205#    It supports KDE4_ENABLE_FINAL.
     206#    If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
     207#
     208#  KDE4_ADD_KDEINIT_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN)
     209#    Create a KDE application in the form of a module loadable via kdeinit.
     210#    A library named kdeinit_<name> will be created and a small executable which links to it.
     211#    It supports KDE4_ENABLE_FINAL
     212#    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
     213#    application bundles are created, with the NOGUI option no bundles but simple executables
     214#    are created. Under Windows this flag is also necessary to separate between applications
     215#    with GUI and without. On other UNIX systems this flag has no effect.
     216#    RUN_UNINSTALLED is deprecated and is ignored, for details see the documentation for
     217#    KDE4_ADD_EXECUTABLE().
     218#
     219#  KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN)
     220#    Equivalent to ADD_EXECUTABLE(), but additionally adds some more features:
     221#    -support for KDE4_ENABLE_FINAL
     222#    -support for automoc
     223#    -automatic RPATH handling
     224#    If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
     225#    application bundles are created, with the NOGUI option no bundles but simple executables
     226#    are created. Under Windows this flag is also necessary to separate between applications
     227#    with GUI and without. On other UNIX systems this flag has no effect.
     228#    The option TEST is for internal use only.
     229#    The option RUN_UNINSTALLED is ignored. It was necessary with KDE 4.0 and 4.1
     230#    if the executable had to be run from the build tree. Since KDE 4.2 all
     231#    executables can be always run uninstalled (the RPATH of executables which are not
     232#    yet installed points since then into the buildtree and is changed
     233#    to the proper location when installing, so RUN_UNINSTALLED is not necessary anymore).
     234#
     235#  KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN)
     236#    Equivalent to ADD_LIBRARY(). Additionally it supports KDE4_ENABLE_FINAL,
     237#    includes automoc-handling and sets LINK_INTERFACE_LIBRARIES target property empty.
     238#    The RPATH is set according to the global RPATH settings as set up by FindKDE4Internal.cmake
     239#    (CMAKE_SKIP_BUILD_RPATH=FALSE, CMAKE_BUILD_WITH_INSTALL_RPATH=FALSE, CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE)
     240#    Under Windows it adds a -DMAKE_<name>_LIB definition to the compilation.
     241#
     242#  KDE4_ADD_UNIT_TEST (testname [TESTNAME targetname] file1 ... fileN)
     243#    add a unit test, which is executed when running make test
     244#    it will be built with RPATH poiting to the build dir
     245#    The targets are always created, but only built for the "all"
     246#    target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
     247#    are created but not built by default. You can build them by manually building the target.
     248#    The name of the target can be specified using TESTNAME <targetname>, if it is not given
     249#    the macro will default to the <testname>
     250#    KDESRCDIR is set to the source directory of the test, this can be used with
     251#    KGlobal::dirs()->addResourceDir( "data", KDESRCDIR )
     252#
     253#
     254#  KDE4_ADD_APP_ICON (SRCS_VAR pattern)
     255#  adds an application icon to target source list.
     256#  Make sure you have a 128x128 icon, or the icon won't display on Mac OS X.
     257#  Mac OSX notes : the application icon is added to a Mac OS X bundle so that Finder and friends show the right thing.
     258#  Win32 notes: the application icon(s) are compiled into the application
     259#  There is some workaround in kde4_add_kdeinit_executable to make it possible for those applications as well.
     260# Parameters:
     261#  SRCS_VAR  - specifies the list of source files
     262#  pattern   - regular expression for searching application icons
     263#  Example: KDE4_ADD_APP_ICON( myapp_SOURCES "pics/cr*-myapp.png")
     264#  Example: KDE4_ADD_APP_ICON( myapp_KDEINIT_SRCS "icons/oxygen/*/apps/myapp.png")
     265#
     266#  KDE4_UPDATE_ICONCACHE()
     267#    Notifies the icon cache that new icons have been installed by updating
     268#    mtime of ${ICON_INSTALL_DIR}/hicolor directory.
     269#
     270#  KDE4_INSTALL_ICONS( path theme)
     271#    Installs all png and svgz files in the current directory to the icon
     272#    directory given in path, in the subdirectory for the given icon theme.
     273#
     274#  KDE4_CREATE_HANDBOOK( docbookfile [INSTALL_DESTINATION installdest] [SUBDIR subdir])
     275#   Create the handbook from the docbookfile (using meinproc4)
     276#   The resulting handbook will be installed to <installdest> when using
     277#   INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if
     278#   SUBDIR <subdir> is specified.
     279#
     280#  KDE4_CREATE_MANPAGE( docbookfile section )
     281#   Create the manpage for the specified section from the docbookfile (using meinproc4)
     282#   The resulting manpage will be installed to <installdest> when using
     283#   INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if
     284#   SUBDIR <subdir> is specified.
     285#
     286#  KDE4_INSTALL_AUTH_ACTIONS( HELPER_ID ACTIONS_FILE )
     287#   This macro generates an action file, depending on the backend used, for applications using KAuth.
     288#   It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example
     289#   for file format). The macro will take care of generating the file according to the backend specified,
     290#   and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy
     291#   file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/),
     292#   and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during
     293#   the install phase
     294#
     295#  KDE4_INSTALL_AUTH_HELPER_FILES( HELPER_TARGET HELPER_ID HELPER_USER )
     296#   This macro adds the needed files for an helper executable meant to be used by applications using KAuth.
     297#   It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on.
     298#   This macro takes care of generate the needed files, and install them in the right location. This boils down
     299#   to a DBus policy to let the helper register on the system bus, and a service file for letting the helper
     300#   being automatically activated by the system bus.
     301#   *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work.
     302#
     303#
     304#
     305#  A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles
     306#  the flags for those buildtypes. FindKDE4Internal supports the values
     307#  Debug, Release, RelWithDebInfo, Profile and Debugfull:
     308#
     309#  Release
     310#          optimised for speed, qDebug/kDebug turned off, no debug symbols, no asserts
     311#  RelWithDebInfo (Release with debug info)
     312#          similar to Release, optimised for speed, but with debugging symbols on (-g)
     313#  Debug
     314#          optimised but debuggable, debugging on (-g)
     315#          (-fno-reorder-blocks -fno-schedule-insns -fno-inline)
     316#  DebugFull
     317#          no optimization, full debugging on (-g3)
     318#  Profile
     319#          DebugFull + -ftest-coverage -fprofile-arcs
     320#
     321#
     322#  The default buildtype is RelWithDebInfo.
     323#  It is expected that the "Debug" build type be still debuggable with gdb
     324#  without going all over the place, but still produce better performance.
     325#  It's also important to note that gcc cannot detect all warning conditions
     326#  unless the optimiser is active.
     327#
     328#
     329#  This module allows to depend on a particular minimum version of kdelibs.
     330#  To acomplish that one should use the appropriate cmake syntax for
     331#  find_package. For example to depend on kdelibs >= 4.1.0 one should use
     332#
     333#  find_package(KDE4 4.1.0 REQUIRED)
     334#
     335#  In earlier versions of KDE you could use the variable KDE_MIN_VERSION to
     336#  have such a dependency. This variable is deprecated with KDE 4.2.0, but
     337#  will still work to make the module backwards-compatible.
     338
     339#  _KDE4_PLATFORM_INCLUDE_DIRS is used only internally
     340#  _KDE4_PLATFORM_DEFINITIONS is used only internally
     341
     342# Copyright (c) 2006-2009, Alexander Neundorf <neundorf@kde.org>
     343# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
     344#
     345# Redistribution and use is allowed according to the terms of the BSD license.
     346# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
     347
     348
     349message(STATUS "Using private FindKDE4Internal module to deactivate hidden visibility building")
     350
     351# this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below
     352cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
     353# set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3)
     354cmake_policy(VERSION 2.4.5)
     355
     356# Policy 25=new: identify Apple Clang as AppleClang to ensure
     357#                consistency in compiler feature determination
     358# Policy 60=new: don't rewrite ${prefix}/lib/libfoo.dylib as -lfoo
     359cmake_policy(SET CMP0025 NEW)
     360cmake_policy(SET CMP0060 NEW)
     361
     362# Only do something if it hasn't been found yet
     363if(NOT KDE4_FOUND)
     364
     365# get the directory of the current file, used later on in the file
     366#get_filename_component( kde_cmake_module_dir  ${CMAKE_CURRENT_LIST_FILE} PATH)
     367set( kde_cmake_module_dir  "@PREFIX@/share/apps/cmake/modules")
     368
     369
     370include (MacroEnsureVersion)
     371
     372# We may only search for other packages with "REQUIRED" if we are required ourselves.
     373# This file can be processed either (usually) included in FindKDE4.cmake or
     374# (when building kdelibs) directly via FIND_PACKAGE(KDE4Internal), that's why
     375# we have to check for both KDE4_FIND_REQUIRED and KDE4Internal_FIND_REQUIRED.
     376if(KDE4_FIND_REQUIRED  OR  KDE4Internal_FIND_REQUIRED)
     377  set(_REQ_STRING_KDE4 "REQUIRED")
     378  set(_REQ_STRING_KDE4_MESSAGE "FATAL_ERROR")
     379else(KDE4_FIND_REQUIRED  OR  KDE4Internal_FIND_REQUIRED)
     380  set(_REQ_STRING_KDE4 )
     381  set(_REQ_STRING_KDE4_MESSAGE "STATUS")
     382endif(KDE4_FIND_REQUIRED  OR  KDE4Internal_FIND_REQUIRED)
     383
     384
     385# Store CMAKE_MODULE_PATH and then append the current dir to it, so we are sure
     386# we get the FindQt4.cmake located next to us and not a different one.
     387# The original CMAKE_MODULE_PATH is restored later on.
     388set(_kde_cmake_module_path_back ${CMAKE_MODULE_PATH})
     389set(CMAKE_MODULE_PATH ${kde_cmake_module_dir} ${CMAKE_MODULE_PATH} )
     390
     391# if the minimum Qt requirement is changed, change all occurrence in the
     392# following lines
     393if( NOT QT_MIN_VERSION )
     394  set(QT_MIN_VERSION "4.8.0")
     395endif( NOT QT_MIN_VERSION )
     396if( ${QT_MIN_VERSION} VERSION_LESS "4.8.0" )
     397  set(QT_MIN_VERSION "4.8.0")
     398endif( ${QT_MIN_VERSION} VERSION_LESS "4.8.0" )
     399
     400# Tell FindQt4.cmake to point the QT_QTFOO_LIBRARY targets at the imported targets
     401# for the Qt libraries, so we get full handling of release and debug versions of the
     402# Qt libs and are flexible regarding the install location of Qt under Windows:
     403set(QT_USE_IMPORTED_TARGETS TRUE)
     404
     405#this line includes FindQt4.cmake, which searches the Qt library and headers
     406# TODO: we should check here that all necessary modules of Qt have been found, e.g. QtDBus
     407find_package(Qt4 ${_REQ_STRING_KDE4})
     408
     409# automoc4 (from kdesupport) is now required, Alex
     410find_package(Automoc4 ${_REQ_STRING_KDE4})
     411
     412# cmake 2.6.0 and automoc4 < 0.9.84 don't work right for -D flags
     413if (NOT AUTOMOC4_VERSION)
     414   # the version macro was added for 0.9.84
     415   set(AUTOMOC4_VERSION "0.9.83")
     416endif (NOT AUTOMOC4_VERSION)
     417set(_automoc4_min_version "0.9.88")
     418macro_ensure_version("${_automoc4_min_version}" "${AUTOMOC4_VERSION}" _automoc4_version_ok)
     419
     420# for compatibility with KDE 4.0.x
     421set(KDE4_AUTOMOC_EXECUTABLE        "${AUTOMOC4_EXECUTABLE}" )
     422
     423# Perl is not required for building KDE software, but we had that here since 4.0
     424find_package(Perl)
     425if(NOT PERL_FOUND)
     426   message(STATUS "Perl not found")
     427endif(NOT PERL_FOUND)
     428
     429# restore the original CMAKE_MODULE_PATH
     430set(CMAKE_MODULE_PATH ${_kde_cmake_module_path_back})
     431
     432# we check for Phonon not here, but further below, i.e. after KDELibsDependencies.cmake
     433# has been loaded, which helps in the case that phonon is installed to the same
     434# directory as kdelibs.
     435# find_package(Phonon ${_REQ_STRING_KDE4})
     436
     437
     438# Check that we really found everything.
     439# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found
     440# already above in the other FIND_PACKAGE() calls.
     441# If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found,
     442# then we get here and must check that everything has actually been found. If something is missing,
     443# we must not fail with FATAL_ERROR, but only not set KDE4_FOUND.
     444
     445if(NOT QT4_FOUND)
     446   message(STATUS "KDE4 not found, because Qt4 was not found")
     447   return()
     448endif(NOT QT4_FOUND)
     449
     450if(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok)
     451   if(NOT AUTOMOC4_FOUND)
     452      message(${_REQ_STRING_KDE4_MESSAGE} "KDE4 not found, because Automoc4 not found.")
     453      return()
     454   else(NOT AUTOMOC4_FOUND)
     455      if(NOT _automoc4_version_ok)
     456         message(${_REQ_STRING_KDE4_MESSAGE} "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least ${_automoc4_min_version}")
     457         return()
     458      endif(NOT _automoc4_version_ok)
     459   endif(NOT AUTOMOC4_FOUND)
     460endif(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok)
     461
     462
     463# now we are sure we have everything we need
     464
     465include (MacroLibrary)
     466include (CheckCXXCompilerFlag)
     467include (CheckCXXSourceCompiles)
     468
     469
     470# are we trying to compile kdelibs ? kdelibs_SOURCE_DIR comes from "project(kdelibs)" in kdelibs/CMakeLists.txt
     471# then enter bootstrap mode
     472
     473if(kdelibs_SOURCE_DIR)
     474   set(_kdeBootStrapping TRUE)
     475   message(STATUS "Building kdelibs...")
     476else(kdelibs_SOURCE_DIR)
     477   set(_kdeBootStrapping FALSE)
     478endif(kdelibs_SOURCE_DIR)
     479
     480
     481# helper macro, sets both the KDE4_FOO_LIBRARY and KDE4_FOO_LIBS variables to KDE4__foo
     482# It is used both in bootstrapping and in normal mode.
     483macro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
     484   set(KDE4_${_var}_LIBRARY ${_prefix}${_lib} )
     485   set(KDE4_${_var}_LIBS    ${_prefix}${_lib} )
     486endmacro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
     487
     488#######################  #now try to find some kde stuff  ################################
     489
     490if (_kdeBootStrapping)
     491   set(KDE4_INCLUDE_DIR ${kdelibs_SOURCE_DIR})
     492
     493   set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin )
     494
     495   if (WIN32)
     496      set(LIBRARY_OUTPUT_PATH               ${EXECUTABLE_OUTPUT_PATH} )
     497      # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC
     498      if (NOT WINCE)
     499        set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
     500        set(KDE4_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 )
     501      else (NOT WINCE)
     502        set(KDE4_KCFGC_EXECUTABLE             ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
     503        set(KDE4_MEINPROC_EXECUTABLE          ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/meinproc4 )
     504      endif(NOT WINCE)
     505
     506      set(KDE4_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 )
     507      set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen )
     508      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets )
     509   else (WIN32)
     510      set(LIBRARY_OUTPUT_PATH               ${CMAKE_BINARY_DIR}/lib )
     511      set(KDE4_KCFGC_EXECUTABLE             ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler${CMAKE_EXECUTABLE_SUFFIX}.shell )
     512      set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen${CMAKE_EXECUTABLE_SUFFIX}.shell )
     513      set(KDE4_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4${CMAKE_EXECUTABLE_SUFFIX}.shell )
     514      set(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell )
     515   endif (WIN32)
     516
     517   set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
     518
     519
     520   # when building kdelibs, make the kcfg rules depend on the binaries...
     521   set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler)
     522   set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP kauth-policy-gen)
     523   set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets)
     524   set( _KDE4_MEINPROC_EXECUTABLE_DEP meinproc4)
     525
     526   set(KDE4_INSTALLED_VERSION_OK TRUE)
     527
     528else (_kdeBootStrapping)
     529
     530  # ... but NOT otherwise
     531   set( _KDE4_KCONFIG_COMPILER_DEP)
     532   set( _KDE4_MAKEKDEWIDGETS_DEP)
     533   set( _KDE4_MEINPROC_EXECUTABLE_DEP)
     534   set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP)
     535
     536   set(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/lib )
     537
     538   if (WIN32)
     539      # we don't want to be forced to set two paths into the build tree
     540      set(LIBRARY_OUTPUT_PATH  ${CMAKE_BINARY_DIR}/bin )
     541
     542      # on win32 the install dir is determined on runtime not install time
     543      # KDELIBS_INSTALL_DIR and QT_INSTALL_DIR are used in KDELibsDependencies.cmake to setup
     544      # kde install paths and library dependencies
     545      get_filename_component(_DIR ${KDE4_KDECONFIG_EXECUTABLE} PATH )
     546      get_filename_component(KDE4_INSTALL_DIR ${_DIR} PATH )
     547      get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH )
     548      get_filename_component(QT_INSTALL_DIR ${_DIR} PATH )
     549   endif (WIN32)
     550
     551   # These files contain information about the installed kdelibs, Alex
     552   include(${kde_cmake_module_dir}/KDELibsDependencies.cmake)
     553   include(${kde_cmake_module_dir}/KDEPlatformProfile.cmake)
     554
     555   # Check the version of KDE. It must be at least KDE_MIN_VERSION as set by the user.
     556   # KDE_VERSION is set in KDELibsDependencies.cmake since KDE 4.0.x. Alex
     557   # Support for the new-style (>= 2.6.0) support for requiring some version of a package:
     558   if (NOT KDE_MIN_VERSION)
     559      if (KDE4_FIND_VERSION_MAJOR)
     560         set(KDE_MIN_VERSION "${KDE4_FIND_VERSION_MAJOR}.${KDE4_FIND_VERSION_MINOR}.${KDE4_FIND_VERSION_PATCH}")
     561      else (KDE4_FIND_VERSION_MAJOR)
     562         set(KDE_MIN_VERSION "4.0.0")
     563      endif (KDE4_FIND_VERSION_MAJOR)
     564   endif (NOT KDE_MIN_VERSION)
     565
     566   #message(FATAL_ERROR "KDE_MIN_VERSION=${KDE_MIN_VERSION}  found ${KDE_VERSION} exact: -${KDE4_FIND_VERSION_EXACT}- version: -${KDE4_FIND_VERSION}-")
     567   macro_ensure_version( ${KDE_MIN_VERSION} ${KDE_VERSION} KDE4_INSTALLED_VERSION_OK )
     568
     569
     570   # KDE4_LIB_INSTALL_DIR and KDE4_INCLUDE_INSTALL_DIR are set in KDELibsDependencies.cmake,
     571   # use them to set the KDE4_LIB_DIR and KDE4_INCLUDE_DIR "public interface" variables
     572   set(KDE4_LIB_DIR ${KDE4_LIB_INSTALL_DIR} )
     573   set(KDE4_INCLUDE_DIR ${KDE4_INCLUDE_INSTALL_DIR} )
     574
     575
     576   # This setting is currently not recorded in KDELibsDependencies.cmake:
     577   find_file(KDE4_PLASMA_OPENGL_FOUND plasma/glapplet.h PATHS ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH)
     578
     579   # Now include the file with the imported tools (executable targets).
     580   # This export-file is generated and installed by the toplevel CMakeLists.txt of kdelibs.
     581   # Having the libs and tools in two separate files should help with cross compiling.
     582   include(${kde_cmake_module_dir}/KDELibs4ToolsTargets.cmake)
     583
     584   # get the build CONFIGURATIONS which were exported in this file, and use just the first
     585   # of them to get the location of the installed executables
     586   get_target_property(_importedConfigurations  ${KDE4_TARGET_PREFIX}kconfig_compiler IMPORTED_CONFIGURATIONS )
     587   list(GET _importedConfigurations 0 _firstConfig)
     588
     589   if(NOT WINCE)
     590   get_target_property(KDE4_KCFGC_EXECUTABLE             ${KDE4_TARGET_PREFIX}kconfig_compiler    LOCATION_${_firstConfig})
     591   get_target_property(KDE4_MEINPROC_EXECUTABLE          ${KDE4_TARGET_PREFIX}meinproc4           LOCATION_${_firstConfig})
     592   else(NOT WINCE)
     593    set(KDE4_KCFGC_EXECUTABLE             ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
     594    set(KDE4_MEINPROC_EXECUTABLE          ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/meinproc4 )
     595   endif(NOT WINCE)
     596   get_target_property(KDE4_KAUTH_POLICY_GEN_EXECUTABLE  ${KDE4_TARGET_PREFIX}kauth-policy-gen    LOCATION_${_firstConfig})
     597   get_target_property(KDE4_MAKEKDEWIDGETS_EXECUTABLE    ${KDE4_TARGET_PREFIX}makekdewidgets      LOCATION_${_firstConfig})
     598
     599   # allow searching cmake modules in all given kde install locations (KDEDIRS based)
     600   execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
     601   file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
     602   foreach(dir ${_data_DIR})
     603      set (apath "${dir}/cmake/modules")
     604      if (EXISTS "${apath}")
     605         set (included 0)
     606         string(TOLOWER "${apath}" _apath)
     607         # ignore already added pathes, case insensitive
     608         foreach(adir ${CMAKE_MODULE_PATH})
     609            string(TOLOWER "${adir}" _adir)
     610            if ("${_adir}" STREQUAL "${_apath}")
     611               set (included 1)
     612            endif ("${_adir}" STREQUAL "${_apath}")
     613         endforeach(adir)
     614         if (NOT included)
     615            message(STATUS "Adding ${apath} to CMAKE_MODULE_PATH")
     616            set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${apath}")
     617         endif (NOT included)
     618      endif (EXISTS "${apath}")
     619   endforeach(dir)
     620
     621
     622   # This file contains the exported library target from kdelibs (new with cmake 2.6.x), e.g.
     623   # the library target "kdeui" is exported as "KDE4__kdeui". The "KDE4__" is used as
     624   # "namespace" to separate the imported targets from "normal" targets, it is stored in
     625   # KDE4_TARGET_PREFIX, which is set in KDELibsDependencies.cmake .
     626   # This export-file is generated and installed by the toplevel CMakeLists.txt of kdelibs.
     627   # Include it to "import" the libraries from kdelibs into the current projects as targets.
     628   # This makes setting the _LIBRARY and _LIBS variables actually a bit superfluos, since e.g.
     629   # the kdeui library could now also be used just as "KDE4__kdeui" and still have all their
     630   # dependent libraries handled correctly. But to keep compatibility and not to change
     631   # behaviour we set all these variables anyway as seen below. Alex
     632   include(${kde_cmake_module_dir}/KDELibs4LibraryTargets.cmake)
     633
     634   # This one is for compatibility only:
     635   set(KDE4_THREADWEAVER_LIBRARIES ${KDE4_TARGET_PREFIX}threadweaver )
     636
     637endif (_kdeBootStrapping)
     638
     639
     640# Set the various KDE4_FOO_LIBRARY/LIBS variables.
     641# In bootstrapping mode KDE4_TARGET_PREFIX is empty, so e.g. KDE4_KDECORE_LIBRARY
     642# will be simply set to "kdecore".
     643
     644# Sorted by names:
     645_kde4_set_lib_variables(KCMUTILS      kcmutils      "${KDE4_TARGET_PREFIX}")
     646_kde4_set_lib_variables(KDE3SUPPORT   kde3support   "${KDE4_TARGET_PREFIX}")
     647_kde4_set_lib_variables(KDECORE       kdecore       "${KDE4_TARGET_PREFIX}")
     648_kde4_set_lib_variables(KDEUI         kdeui         "${KDE4_TARGET_PREFIX}")
     649_kde4_set_lib_variables(KDEWEBKIT     kdewebkit     "${KDE4_TARGET_PREFIX}")
     650_kde4_set_lib_variables(KDNSSD        kdnssd        "${KDE4_TARGET_PREFIX}")
     651_kde4_set_lib_variables(KEMOTICONS    kemoticons    "${KDE4_TARGET_PREFIX}")
     652_kde4_set_lib_variables(KFILE         kfile         "${KDE4_TARGET_PREFIX}")
     653_kde4_set_lib_variables(KHTML         khtml         "${KDE4_TARGET_PREFIX}")
     654_kde4_set_lib_variables(KIDLETIME     kidletime     "${KDE4_TARGET_PREFIX}")
     655_kde4_set_lib_variables(KIO           kio           "${KDE4_TARGET_PREFIX}")
     656_kde4_set_lib_variables(KJS           kjs           "${KDE4_TARGET_PREFIX}")
     657_kde4_set_lib_variables(KJSAPI        kjsapi        "${KDE4_TARGET_PREFIX}")
     658_kde4_set_lib_variables(KNEWSTUFF2    knewstuff2    "${KDE4_TARGET_PREFIX}")
     659_kde4_set_lib_variables(KNEWSTUFF3    knewstuff3    "${KDE4_TARGET_PREFIX}")
     660_kde4_set_lib_variables(KNOTIFYCONFIG knotifyconfig "${KDE4_TARGET_PREFIX}")
     661_kde4_set_lib_variables(KPARTS        kparts        "${KDE4_TARGET_PREFIX}")
     662_kde4_set_lib_variables(KPRINTUTILS   kprintutils   "${KDE4_TARGET_PREFIX}")
     663_kde4_set_lib_variables(KROSSCORE     krosscore     "${KDE4_TARGET_PREFIX}")
     664_kde4_set_lib_variables(KROSSUI       krossui       "${KDE4_TARGET_PREFIX}")
     665_kde4_set_lib_variables(KTEXTEDITOR   ktexteditor   "${KDE4_TARGET_PREFIX}")
     666_kde4_set_lib_variables(KUNITCONVERSION kunitconversion "${KDE4_TARGET_PREFIX}")
     667_kde4_set_lib_variables(KUTILS        kutils        "${KDE4_TARGET_PREFIX}")
     668_kde4_set_lib_variables(PLASMA        plasma        "${KDE4_TARGET_PREFIX}")
     669_kde4_set_lib_variables(SOLID         solid         "${KDE4_TARGET_PREFIX}")
     670_kde4_set_lib_variables(THREADWEAVER  threadweaver  "${KDE4_TARGET_PREFIX}")
     671
     672if (UNIX)
     673   _kde4_set_lib_variables(KDEFAKES kdefakes "${KDE4_TARGET_PREFIX}")
     674   _kde4_set_lib_variables(KDESU kdesu       "${KDE4_TARGET_PREFIX}")
     675   _kde4_set_lib_variables(KPTY kpty         "${KDE4_TARGET_PREFIX}")
     676endif (UNIX)
     677
     678# The nepomuk target does not always exist, since is is built conditionally. When bootstrapping
     679# we set it always anyways.
     680if(_kdeBootStrapping  OR  TARGET ${KDE4_TARGET_PREFIX}nepomuk)
     681   _kde4_set_lib_variables(NEPOMUK nepomuk "${KDE4_TARGET_PREFIX}")
     682endif(_kdeBootStrapping  OR  TARGET ${KDE4_TARGET_PREFIX}nepomuk)
     683
     684
     685################### try to find Phonon ############################################
     686
     687# we do this here instead of above together with the checks for Perl etc.
     688# since FindPhonon.cmake also uses ${KDE4_LIB_INSTALL_DIR} to check for Phonon,
     689# which helps with finding the phonon installed as part of kdesupport:
     690
     691# only make Phonon REQUIRED if KDE4 itself is REQUIRED
     692find_package(Phonon 4.3.80 ${_REQ_STRING_KDE4})
     693set(KDE4_PHONON_LIBRARY ${PHONON_LIBRARY})
     694set(KDE4_PHONON_LIBS ${PHONON_LIBS})
     695set(KDE4_PHONON_INCLUDES ${PHONON_INCLUDES})
     696
     697if(NOT PHONON_FOUND)
     698   message(STATUS "KDE4 not found, because Phonon was not found")
     699   return()
     700endif(NOT PHONON_FOUND)
     701
     702
     703#####################  provide some options   ##########################################
     704
     705option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation")
     706option(KDE4_BUILD_TESTS  "Build the tests" ON)
     707option(KDE4_ENABLE_HTMLHANDBOOK  "Create targets htmlhandbook for creating the html versions of the docbook docs")
     708set(KDE4_SERIALIZE_TOOL "" CACHE STRING "Tool to serialize resource-intensive commands in parallel builds")
     709
     710# if CMake 2.6.3 or above is used, provide an option which should be used by other KDE packages
     711# whether to install a CMake FooConfig.cmake into lib/foo/cmake/ or /lib/cmake/foo/
     712# (with 2.6.3 and above also lib/cmake/foo/ is supported):
     713if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
     714   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)
     715else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
     716   set(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR  FALSE)
     717endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
     718
     719# Position-Independent-Executable is a feature of Binutils, Libc, and GCC that creates an executable
     720# which is something between a shared library and a normal executable.
     721# Programs compiled with these features appear as ?shared object? with the file command.
     722# info from "http://www.linuxfromscratch.org/hlfs/view/unstable/glibc/chapter02/pie.html"
     723option(KDE4_ENABLE_FPIE  "Enable platform supports PIE linking")
     724
     725if (WIN32)
     726   list(APPEND CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/share/apps/cmake/modules")
     727   find_package(KDEWin REQUIRED)
     728   option(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF)
     729   if (KDE4_ENABLE_UAC_MANIFEST)
     730      find_program(KDE4_MT_EXECUTABLE mt
     731         PATHS ${KDEWIN_INCLUDE_DIR}/../bin
     732         NO_DEFAULT_PATH
     733      )
     734      if (KDE4_MT_EXECUTABLE)
     735         message(STATUS "Found KDE manifest tool at ${KDE4_MT_EXECUTABLE} ")
     736      else (KDE4_MT_EXECUTABLE)
     737         message(STATUS "KDE manifest tool not found, manifest generating for Windows Vista disabled")
     738         set (KDE4_ENABLE_UAC_MANIFEST OFF)
     739      endif (KDE4_MT_EXECUTABLE)
     740   endif (KDE4_ENABLE_UAC_MANIFEST)
     741endif (WIN32)
     742
     743#####################  some more settings   ##########################################
     744
     745if( KDE4_ENABLE_FINAL)
     746   add_definitions(-DKDE_USE_FINAL)
     747endif(KDE4_ENABLE_FINAL)
     748
     749if(KDE4_SERIALIZE_TOOL)
     750   # parallel build with many meinproc invocations can consume a huge amount of memory
     751   set(KDE4_MEINPROC_EXECUTABLE ${KDE4_SERIALIZE_TOOL} ${KDE4_MEINPROC_EXECUTABLE})
     752endif(KDE4_SERIALIZE_TOOL)
     753
     754# If we are building ! kdelibs, check where kdelibs are installed.
     755# If they are installed in a directory which contains "lib64", we default to "64" for LIB_SUFFIX,
     756# so the current project will by default also go into lib64.
     757# The same for lib32. Alex
     758set(_Init_LIB_SUFFIX "")
     759if ("${KDE4_LIB_DIR}" MATCHES lib64)
     760   set(_Init_LIB_SUFFIX 64)
     761endif ("${KDE4_LIB_DIR}" MATCHES lib64)
     762if ("${KDE4_LIB_DIR}" MATCHES lib32)
     763   set(_Init_LIB_SUFFIX 32)
     764endif ("${KDE4_LIB_DIR}" MATCHES lib32)
     765
     766set(LIB_SUFFIX "${_Init_LIB_SUFFIX}" CACHE STRING "Define suffix of directory name (32/64)" )
     767
     768
     769########## the following are directories where stuff will be installed to  ###########
     770#
     771# this has to be after find_xxx() block above, since there KDELibsDependencies.cmake is included
     772# which contains the install dirs from kdelibs, which are reused below
     773
     774if (WIN32)
     775# use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files
     776
     777   set(LIB_INSTALL_DIR      "lib${LIB_SUFFIX}" )            # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
     778
     779   set(EXEC_INSTALL_PREFIX  "" )        # Base directory for executables and libraries
     780   set(SHARE_INSTALL_PREFIX "share" )   # Base directory for files which go to share/
     781   set(BIN_INSTALL_DIR      "bin"   )   # The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)
     782   set(SBIN_INSTALL_DIR     "sbin"  )   # The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)
     783
     784   set(LIBEXEC_INSTALL_DIR  "${BIN_INSTALL_DIR}"          ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${BIN_INSTALL_DIR})
     785   set(INCLUDE_INSTALL_DIR  "include"                     ) # The subdirectory to the header prefix
     786
     787   set(PLUGIN_INSTALL_DIR       "lib${LIB_SUFFIX}/kde4"   ) #                "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)
     788   set(IMPORTS_INSTALL_DIR       "${PLUGIN_INSTALL_DIR}/imports"   ) # "The subdirectory relative to the install prefix where imports will be installed
     789   set(CONFIG_INSTALL_DIR       "share/config"            ) # The config file install dir
     790   set(DATA_INSTALL_DIR         "share/apps"              ) # The parent directory where applications can install their data
     791   set(HTML_INSTALL_DIR         "share/doc/HTML"          ) # The HTML install dir for documentation
     792   set(ICON_INSTALL_DIR         "share/icons"             ) # The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)
     793   set(KCFG_INSTALL_DIR         "share/config.kcfg"       ) # The install dir for kconfig files
     794   set(LOCALE_INSTALL_DIR       "share/locale"            ) # The install dir for translations
     795   set(MIME_INSTALL_DIR         "share/mimelnk"           ) # The install dir for the mimetype desktop files
     796   set(SERVICES_INSTALL_DIR     "share/kde4/services"     ) # The install dir for service (desktop, protocol, ...) files
     797   set(SERVICETYPES_INSTALL_DIR "share/kde4/servicetypes" ) # The install dir for servicestypes desktop files
     798   set(SOUND_INSTALL_DIR        "share/sounds"            ) # The install dir for sound files
     799   set(TEMPLATES_INSTALL_DIR    "share/templates"         ) # The install dir for templates (Create new file...)
     800   set(WALLPAPER_INSTALL_DIR    "share/wallpapers"        ) # The install dir for wallpapers
     801   set(DEMO_INSTALL_DIR         "share/demos"             ) # The install dir for demos
     802   set(KCONF_UPDATE_INSTALL_DIR "share/apps/kconf_update" ) # The kconf_update install dir
     803   set(AUTOSTART_INSTALL_DIR    "share/autostart"         ) # The install dir for autostart files
     804
     805   set(XDG_APPS_INSTALL_DIR      "share/applications/kde4"   ) # The XDG apps dir
     806   set(XDG_DIRECTORY_INSTALL_DIR "share/desktop-directories" ) # The XDG directory
     807   set(XDG_MIME_INSTALL_DIR      "share/mime/packages"       ) # The install dir for the xdg mimetypes
     808
     809   set(SYSCONF_INSTALL_DIR       "etc"                       ) # The sysconfig install dir (default /etc)
     810   set(MAN_INSTALL_DIR           "share/man"                 ) # The man install dir (default ${SHARE_INSTALL_PREFIX}/man/)
     811   set(INFO_INSTALL_DIR          "share/info"                ) # The info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
     812   set(DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" ) # The dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
     813   set(DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services"     ) # The dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
     814   set(DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services"     ) # The dbus system services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")
     815
     816else (WIN32)
     817
     818   # This macro implements some very special logic how to deal with the cache.
     819   # By default the various install locations inherit their value from their "parent" variable
     820   # so if you set CMAKE_INSTALL_PREFIX, then EXEC_INSTALL_PREFIX, PLUGIN_INSTALL_DIR will
     821   # calculate their value by appending subdirs to CMAKE_INSTALL_PREFIX .
     822   # This would work completely without using the cache.
     823   # But if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value has to go into
     824   # the cache, otherwise it will be forgotten on the next cmake run.
     825   # Once a variable is in the cache, it doesn't depend on its "parent" variables
     826   # anymore and you can only change it by editing it directly.
     827   # this macro helps in this regard, because as long as you don't set one of the
     828   # variables explicitly to some location, it will always calculate its value from its
     829   # parents. So modifying CMAKE_INSTALL_PREFIX later on will have the desired effect.
     830   # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special location
     831   # this will go into the cache and it will no longer depend on CMAKE_INSTALL_PREFIX.
     832   #
     833   # additionally if installing to the same location as kdelibs, the other install
     834   # directories are reused from the installed kdelibs
     835   macro(_SET_FANCY _var _value _comment)
     836      set(predefinedvalue "${_value}")
     837      if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
     838         set(predefinedvalue "${KDE4_${_var}}")
     839      endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
     840
     841      if (NOT DEFINED ${_var})
     842         set(${_var} ${predefinedvalue})
     843      else (NOT DEFINED ${_var})
     844         set(${_var} "${${_var}}" CACHE PATH "${_comment}")
     845      endif (NOT DEFINED ${_var})
     846   endmacro(_SET_FANCY)
     847
     848   if(APPLE)
     849      set(BUNDLE_INSTALL_DIR "/Applications/KDE4" CACHE PATH "Directory where application bundles will be installed to on OSX" )
     850   endif(APPLE)
     851
     852   _set_fancy(EXEC_INSTALL_PREFIX  "${CMAKE_INSTALL_PREFIX}"                 "Base directory for executables and libraries")
     853   _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share"           "Base directory for files which go to share/")
     854   _set_fancy(BIN_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/bin"              "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
     855   _set_fancy(SBIN_INSTALL_DIR     "${EXEC_INSTALL_PREFIX}/sbin"             "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)")
     856   _set_fancy(LIB_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})")
     857   _set_fancy(LIBEXEC_INSTALL_DIR  "${LIB_INSTALL_DIR}/kde4/libexec"         "The subdirectory relative to the install prefix where libraries will be installed (default is ${LIB_INSTALL_DIR}/kde4/libexec)")
     858   _set_fancy(INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include"         "The subdirectory to the header prefix")
     859
     860   _set_fancy(PLUGIN_INSTALL_DIR       "${LIB_INSTALL_DIR}/kde4"                "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)")
     861   _set_fancy(IMPORTS_INSTALL_DIR       "${PLUGIN_INSTALL_DIR}/imports"                "The subdirectory relative to the install prefix where imports will be installed")
     862   _set_fancy(CONFIG_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/config"         "The config file install dir")
     863   _set_fancy(DATA_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/apps"           "The parent directory where applications can install their data")
     864   _set_fancy(HTML_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/doc/HTML"       "The HTML install dir for documentation")
     865   _set_fancy(ICON_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/icons"          "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)")
     866   _set_fancy(KCFG_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/config.kcfg"    "The install dir for kconfig files")
     867   _set_fancy(LOCALE_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/locale"         "The install dir for translations")
     868   _set_fancy(MIME_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/mimelnk"        "The install dir for the mimetype desktop files")
     869   _set_fancy(SERVICES_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/kde4/services"  "The install dir for service (desktop, protocol, ...) files")
     870   _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files")
     871   _set_fancy(SOUND_INSTALL_DIR        "${SHARE_INSTALL_PREFIX}/sounds"         "The install dir for sound files")
     872   _set_fancy(TEMPLATES_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/templates"      "The install dir for templates (Create new file...)")
     873   _set_fancy(WALLPAPER_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/wallpapers"     "The install dir for wallpapers")
     874   _set_fancy(DEMO_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/demos"          "The install dir for demos")
     875   _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update"       "The kconf_update install dir")
     876   _set_fancy(AUTOSTART_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/autostart"      "The install dir for autostart files")
     877
     878   _set_fancy(XDG_APPS_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/applications/kde4"         "The XDG apps dir")
     879   _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories"      "The XDG directory")
     880   _set_fancy(XDG_MIME_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/mime/packages"  "The install dir for the xdg mimetypes")
     881
     882   _set_fancy(SYSCONF_INSTALL_DIR      "${CMAKE_INSTALL_PREFIX}/etc"            "The sysconfig install dir (default ${CMAKE_INSTALL_PREFIX}/etc)")
     883   _set_fancy(MAN_INSTALL_DIR          "${SHARE_INSTALL_PREFIX}/man"            "The man install dir (default ${SHARE_INSTALL_PREFIX}/man/)")
     884   _set_fancy(INFO_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/info"           "The info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
     885   _set_fancy(DBUS_INTERFACES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
     886   _set_fancy(DBUS_SERVICES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/services"     "The dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
     887   _set_fancy(DBUS_SYSTEM_SERVICES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/system-services"     "The dbus system services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")
     888
     889endif (WIN32)
     890
     891
     892# For more documentation see above.
     893# Later on it will be possible to extend this for installing OSX frameworks
     894# The COMPONENT Devel argument has the effect that static libraries belong to the
     895# "Devel" install component. If we use this also for all install() commands
     896# for header files, it will be possible to install
     897#   -everything: make install OR cmake -P cmake_install.cmake
     898#   -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake
     899#   -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake
     900# This can then also be used for packaging with cpack.
     901set(INSTALL_TARGETS_DEFAULT_ARGS  RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
     902                                  LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
     903                                  ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel )
     904
     905
     906# on the Mac support an extra install directory for application bundles starting with cmake 2.6
     907if(APPLE)
     908   set(INSTALL_TARGETS_DEFAULT_ARGS  ${INSTALL_TARGETS_DEFAULT_ARGS}
     909                               BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" )
     910endif(APPLE)
     911
     912
     913##############  add some more default search paths  ###############
     914#
     915# the KDE4_xxx_INSTALL_DIR variables are empty when building kdelibs itself
     916# and otherwise point to the kde4 install dirs
     917
     918set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
     919                              "${KDE4_INCLUDE_INSTALL_DIR}")
     920
     921set(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
     922                              "${KDE4_BIN_INSTALL_DIR}" )
     923
     924set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
     925                              "${KDE4_LIB_INSTALL_DIR}" )
     926
     927# under Windows dlls may be also installed in bin/
     928if(WIN32)
     929  set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
     930                                "${_CMAKE_INSTALL_DIR}/bin"
     931                                "${CMAKE_INSTALL_PREFIX}/bin" )
     932endif(WIN32)
     933
     934
     935######################################################
     936#  and now the platform specific stuff
     937######################################################
     938
     939# Set a default build type for single-configuration
     940# CMake generators if no build type is set.
     941if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
     942   set(CMAKE_BUILD_TYPE RelWithDebInfo)
     943endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
     944
     945
     946if (WIN32)
     947
     948   if(CYGWIN)
     949      message(FATAL_ERROR "Cygwin is NOT supported, use mingw or MSVC to build KDE4.")
     950   endif(CYGWIN)
     951
     952   # limit win32 packaging to kdelibs at now
     953   # don't know if package name, version and notes are always available
     954   if(_kdeBootStrapping)
     955      find_package(KDEWIN_Packager)
     956      if (KDEWIN_PACKAGER_FOUND)
     957         kdewin_packager("kdelibs" "${KDE_VERSION}" "KDE base library" "")
     958      endif (KDEWIN_PACKAGER_FOUND)
     959
     960      include(Win32Macros)
     961      addExplorerWrapper("kdelibs")
     962   endif(_kdeBootStrapping)
     963
     964   set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN_INCLUDES})
     965
     966   # if we are compiling kdelibs, add KDEWIN_LIBRARIES explicitly,
     967   # otherwise they come from KDELibsDependencies.cmake, Alex
     968   if (_kdeBootStrapping)
     969      set( KDE4_KDECORE_LIBS ${KDE4_KDECORE_LIBS} ${KDEWIN_LIBRARIES} )
     970   endif (_kdeBootStrapping)
     971
     972   # we prefer to use a different postfix for debug libs only on Windows
     973   # does not work atm
     974   set(CMAKE_DEBUG_POSTFIX "")
     975
     976   # windows, microsoft compiler
     977   if(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
     978      set( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN )
     979
     980      # C4250: 'class1' : inherits 'class2::member' via dominance
     981      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4250" )
     982      # C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
     983      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4251" )
     984      # C4396: 'identifier' : 'function' the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
     985      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4396" )
     986      # to avoid a lot of deprecated warnings
     987      add_definitions( -D_CRT_SECURE_NO_DEPRECATE
     988                       -D_CRT_SECURE_NO_WARNINGS
     989                       -D_CRT_NONSTDC_NO_DEPRECATE
     990                       -D_SCL_SECURE_NO_WARNINGS
     991                       )
     992      # 'identifier' : no suitable definition provided for explicit template instantiation request
     993      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4661" )
     994   endif(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
     995
     996
     997   # for visual studio IDE set the path correctly for custom commands
     998   # maybe under windows bat-files should be generated for running apps during the build
     999   if(MSVC_IDE)
     1000     get_filename_component(PERL_LOCATION "${PERL_EXECUTABLE}" PATH)
     1001     file(TO_NATIVE_PATH "${PERL_LOCATION}" PERL_PATH_WINDOWS)
     1002     file(TO_NATIVE_PATH "${QT_BINARY_DIR}" QT_BIN_DIR_WINDOWS)
     1003     set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}"
     1004       CACHE STATIC "MSVC IDE Run path" FORCE)
     1005   endif(MSVC_IDE)
     1006
     1007   # we don't support anything below w2k and all winapi calls are unicodes
     1008   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -D_WIN32_IE=0x0501 -DUNICODE" )
     1009endif (WIN32)
     1010
     1011
     1012# setup default RPATH/install_name handling, may be overridden by KDE4_HANDLE_RPATH_FOR_EXECUTABLE
     1013# It sets up to build with full RPATH. When installing, RPATH will be changed to the LIB_INSTALL_DIR
     1014# and all link directories which are not inside the current build dir.
     1015if (UNIX)
     1016   set( _KDE4_PLATFORM_INCLUDE_DIRS)
     1017
     1018   # the rest is RPATH handling
     1019   # here the defaults are set
     1020   # which are partly overwritten in kde4_handle_rpath_for_library()
     1021   # and kde4_handle_rpath_for_executable(), both located in KDE4Macros.cmake, Alex
     1022   if (APPLE)
     1023      set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
     1024   else (APPLE)
     1025      # add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of the standard system link
     1026      # directories listed in CMAKE_{PLATFORM,C,CXX}_IMPLICIT_LINK_DIRECTORIES) and use the RPATH figured out by cmake when compiling
     1027
     1028      list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemPlatformLibDir)
     1029      list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCLibDir)
     1030      list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCxxLibDir)
     1031      if("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")
     1032         set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
     1033      endif("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")
     1034
     1035      set(CMAKE_SKIP_BUILD_RPATH FALSE)
     1036      set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
     1037      set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
     1038   endif (APPLE)
     1039endif (UNIX)
     1040
     1041
     1042if (Q_WS_X11)
     1043   # Done by FindQt4.cmake already
     1044   #find_package(X11 REQUIRED)
     1045   # UNIX has already set _KDE4_PLATFORM_INCLUDE_DIRS, so append
     1046   set(_KDE4_PLATFORM_INCLUDE_DIRS ${_KDE4_PLATFORM_INCLUDE_DIRS} ${X11_INCLUDE_DIR} )
     1047endif (Q_WS_X11)
     1048
     1049
     1050# This will need to be modified later to support either Qt/X11 or Qt/Mac builds
     1051if (APPLE)
     1052
     1053  set ( _KDE4_PLATFORM_DEFINITIONS -D__APPLE_KDE__ )
     1054
     1055  # we need to set MACOSX_DEPLOYMENT_TARGET to (I believe) at least 10.2 or maybe 10.3 to allow
     1056  # -undefined dynamic_lookup; in the future we should do this programmatically
     1057  # hmm... why doesn't this work?
     1058  set (ENV{MACOSX_DEPLOYMENT_TARGET} 10.3)
     1059
     1060  # "-undefined dynamic_lookup" means we don't care about missing symbols at link-time by default
     1061  # this is bad, but unavoidable until there is the equivalent of libtool -no-undefined implemented
     1062  # or perhaps it already is, and I just don't know where to look  ;)
     1063
     1064  set (CMAKE_SHARED_LINKER_FLAGS "-single_module -multiply_defined suppress ${CMAKE_SHARED_LINKER_FLAGS}")
     1065  set (CMAKE_MODULE_LINKER_FLAGS "-multiply_defined suppress ${CMAKE_MODULE_LINKER_FLAGS}")
     1066  #set(CMAKE_SHARED_LINKER_FLAGS "-single_module -undefined dynamic_lookup -multiply_defined suppress")
     1067  #set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup -multiply_defined suppress")
     1068
     1069  # we profile...
     1070  if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
     1071    set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     1072    set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     1073  endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
     1074
     1075  # removed -Os, was there a special reason for using -Os instead of -O2 ?, Alex
     1076  # optimization flags are set below for the various build types
     1077  set (CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -fno-common")
     1078  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common")
     1079endif (APPLE)
     1080
     1081
     1082if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
     1083   if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     1084      set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE)
     1085      set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
     1086      set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
     1087
     1088      set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_SHARED_LINKER_FLAGS}")
     1089      set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_MODULE_LINKER_FLAGS}")
     1090      set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_EXE_LINKER_FLAGS}")
     1091
     1092      # we profile...
     1093      if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
     1094        set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     1095        set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
     1096      endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
     1097   endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     1098   if (CMAKE_C_COMPILER MATCHES "icc")
     1099      set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE)
     1100      set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
     1101      set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
     1102   endif (CMAKE_C_COMPILER MATCHES "icc")
     1103endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
     1104
     1105if (UNIX)
     1106   set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} ")
     1107
     1108   check_cxx_source_compiles("
     1109#include <sys/types.h>
     1110 /* Check that off_t can represent 2**63 - 1 correctly.
     1111    We can't simply define LARGE_OFF_T to be 9223372036854775807,
     1112    since some C++ compilers masquerading as C compilers
     1113    incorrectly reject 9223372036854775807.  */
     1114#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
     1115
     1116  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
     1117  int main() { return 0; }
     1118" _OFFT_IS_64BIT)
     1119
     1120   if (NOT _OFFT_IS_64BIT)
     1121     set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_FILE_OFFSET_BITS=64")
     1122   endif (NOT _OFFT_IS_64BIT)
     1123endif (UNIX)
     1124
     1125
     1126############################################################
     1127# compiler specific settings
     1128############################################################
     1129
     1130
     1131# this macro is for internal use only.
     1132macro(KDE_CHECK_FLAG_EXISTS FLAG VAR DOC)
     1133   if(NOT ${VAR} MATCHES "${FLAG}")
     1134      set(${VAR} "${${VAR}} ${FLAG}" CACHE STRING "Flags used by the linker during ${DOC} builds." FORCE)
     1135   endif(NOT ${VAR} MATCHES "${FLAG}")
     1136endmacro(KDE_CHECK_FLAG_EXISTS FLAG VAR)
     1137
     1138if (MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
     1139   set (KDE4_ENABLE_EXCEPTIONS -EHsc)
     1140
     1141   # Qt disables the native wchar_t type, do it too to avoid linking issues
     1142   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:wchar_t-" )
     1143
     1144   # make sure that no header adds libcmt by default using #pragma comment(lib, "libcmt.lib") as done by mfc/afx.h
     1145   kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "Release with Debug Info")
     1146   kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELEASE "release")
     1147   kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "release minsize")
     1148   kde_check_flag_exists("/NODEFAULTLIB:libcmtd /DEFAULTLIB:msvcrtd" CMAKE_EXE_LINKER_FLAGS_DEBUG "debug")
     1149endif(MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
     1150
     1151# This macro is for internal use only
     1152# Return the directories present in gcc's include path.
     1153macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result)
     1154  set(${_result})
     1155  set(_gccOutput)
     1156  file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
     1157  execute_process(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
     1158                  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
     1159                  ERROR_VARIABLE _gccOutput
     1160                  OUTPUT_VARIABLE _gccStdout )
     1161  file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
     1162
     1163  if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
     1164    SET(${_result} ${CMAKE_MATCH_1})
     1165    STRING(REPLACE "\n" " " ${_result} "${${_result}}")
     1166    SEPARATE_ARGUMENTS(${_result})
     1167  ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
     1168ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
     1169
     1170if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
     1171   _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs)
     1172   set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
     1173       ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
     1174endif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES Clang)
     1175
     1176if (CMAKE_COMPILER_IS_GNUCXX)
     1177   _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
     1178   set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
     1179       ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
     1180
     1181   set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")
     1182   # Select flags.
     1183   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
     1184   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1185   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
     1186   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
     1187   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
     1188   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
     1189   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1190   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
     1191   set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
     1192   set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
     1193
     1194   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")
     1195   # As of Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
     1196   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")
     1197
     1198   if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
     1199     # This should not be needed, as it is also part of _KDE4_PLATFORM_DEFINITIONS below.
     1200     # It is kept here nonetheless both for backwards compatibility in case one does not use add_definitions(${KDE4_DEFINITIONS})
     1201     # and also because it is/was needed by glibc for snprintf to be available when building C files.
     1202     # See commit 4a44862b2d178c1d2e1eb4da90010d19a1e4a42c.
     1203     add_definitions (-D_DEFAULT_SOURCE -D_BSD_SOURCE)
     1204   endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
     1205
     1206   if (CMAKE_SYSTEM_NAME STREQUAL GNU)
     1207      set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
     1208      set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
     1209   endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
     1210
     1211   # gcc under Windows
     1212   if (MINGW)
     1213      set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols")
     1214      set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols")
     1215   endif (MINGW)
     1216
     1217   check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT)
     1218   if(KDE4_ENABLE_FPIE)
     1219       if(HAVE_FPIE_SUPPORT)
     1220        set (KDE4_CXX_FPIE_FLAGS "-fPIE")
     1221        set (KDE4_PIE_LDFLAGS "-pie")
     1222       else(HAVE_FPIE_SUPPORT)
     1223        message(STATUS "Your compiler doesn't support the PIE flag")
     1224       endif(HAVE_FPIE_SUPPORT)
     1225   endif(KDE4_ENABLE_FPIE)
     1226
     1227   check_cxx_compiler_flag(-Woverloaded-virtual __KDE_HAVE_W_OVERLOADED_VIRTUAL)
     1228   if(__KDE_HAVE_W_OVERLOADED_VIRTUAL)
     1229       set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
     1230   endif(__KDE_HAVE_W_OVERLOADED_VIRTUAL)
     1231
     1232   # visibility support
     1233   #check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY)
     1234   #set( __KDE_HAVE_GCC_VISIBILITY ${__KDE_HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
     1235   set( __KDE_HAVE_GCC_VISIBILITY 0 CACHE BOOL "GCC support for hidden visibility")
     1236   message(STATUS "__KDE_HAVE_GCC_VISIBILITY=${__KDE_HAVE_GCC_VISIBILITY}")
     1237
     1238   # get the gcc version
     1239   exec_program(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_COMPILER_ARG1} --version OUTPUT_VARIABLE _gcc_version_info)
     1240
     1241   string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
     1242   # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here:
     1243   if (NOT _gcc_version)
     1244      string (REGEX MATCH ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${gcc_on_macos}")
     1245      if (gcc_on_macos)
     1246        string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
     1247      endif (gcc_on_macos)
     1248   endif (NOT _gcc_version)
     1249
     1250   if (_gcc_version)
     1251      macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1)
     1252      macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2)
     1253      macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3)
     1254   endif (_gcc_version)
     1255
     1256   # save a little by making local statics not threadsafe
     1257   # ### do not enable it for older compilers, see
     1258   # ### http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
     1259   if (GCC_IS_NEWER_THAN_4_3)
     1260       set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics")
     1261   endif (GCC_IS_NEWER_THAN_4_3)
     1262
     1263   set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE)
     1264   if (GCC_IS_NEWER_THAN_4_1)
     1265      exec_program(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_COMPILER_ARG1} -v OUTPUT_VARIABLE _gcc_alloc_info)
     1266      string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}")
     1267   endif (GCC_IS_NEWER_THAN_4_1)
     1268
     1269   if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
     1270      set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}")
     1271
     1272      # first check if we can compile a Qt application
     1273      set(_source "#include <QtCore/QtGlobal>\n int main() \n {\n return 0; \n } \n")
     1274      set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_application.cpp)
     1275      file(WRITE "${_source_file}" "${_source}")
     1276
     1277      try_compile(_basic_compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" OUTPUT_VARIABLE _compile_output_var)
     1278
     1279      if(_basic_compile_result)
     1280#            # now ready to check for visibility=hidden
     1281#            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
     1282#            set (KDE4_C_FLAGS "-fvisibility=hidden")
     1283#            # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default")))
     1284#            # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break
     1285#            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")
     1286#            set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp)
     1287#            file(WRITE "${_source_file}" "${_source}")
     1288#
     1289#            try_compile(_compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" OUTPUT_VARIABLE _compile_output_var)
     1290#
     1291#            if(NOT _compile_result)
     1292#               message("${_compile_output_var}")
     1293#               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).")
     1294#            endif(NOT _compile_result)
     1295       else(_basic_compile_result)
     1296         message("${_compile_output_var}")
     1297         message(FATAL_ERROR "Unable to compile a basic Qt application. Qt has not been found correctly.")
     1298       endif(_basic_compile_result)
     1299
     1300      if (GCC_IS_NEWER_THAN_4_2)
     1301         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type -fvisibility-inlines-hidden")
     1302      endif (GCC_IS_NEWER_THAN_4_2)
     1303   else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
     1304         message(WARNING "Turning off hidden visibility")
     1305      set (__KDE_HAVE_GCC_VISIBILITY 0)
     1306   endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
     1307
     1308endif (CMAKE_COMPILER_IS_GNUCXX)
     1309
     1310
     1311# Detect Clang the proper way (= including AppleClang)
     1312if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     1313   _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
     1314   set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
     1315       ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
     1316
     1317   # Note that exceptions are enabled by default when building with clang. That
     1318   # is, -fno-exceptions is not set in CMAKE_CXX_FLAGS below. This is because a
     1319   # lot of code in different KDE modules ends up including code that throws
     1320   # exceptions. Most (or all) of the occurrences are in template code that
     1321   # never gets instantiated. Contrary to GCC, ICC and MSVC, clang (most likely
     1322   # rightfully) complains about that. Trying to work around the issue by
     1323   # passing -fdelayed-template-parsing brings other problems, as noted in
     1324   # http://lists.kde.org/?l=kde-core-devel&m=138157459706783&w=2.
     1325   # The generated code will be slightly bigger, but there is no way to avoid
     1326   # it.
     1327   set(KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")
     1328
     1329   # Select flags.
     1330   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
     1331   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1332   set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-inline")
     1333   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
     1334   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
     1335   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
     1336   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1337   set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-inline")
     1338   set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
     1339   set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
     1340
     1341   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")
     1342   #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-common -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden")
     1343   #set(KDE4_C_FLAGS    "-fvisibility=hidden")
     1344   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-common -Werror=return-type")
     1345   set(KDE4_C_FLAGS    "")
     1346
     1347   # At least kdepim exports one function with C linkage that returns a
     1348   # QString in a plugin, but clang does not like that.
     1349   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
     1350
     1351   set(KDE4_CXX_FPIE_FLAGS "-fPIE")
     1352   set(KDE4_PIE_LDFLAGS    "-pie")
     1353
     1354   if (CMAKE_SYSTEM_NAME STREQUAL GNU)
     1355      set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
     1356      set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
     1357   endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
     1358
     1359   message(STATUS "Building with Clang but no hidden visibility")
     1360   set(__KDE_HAVE_GCC_VISIBILITY FALSE)
     1361
     1362   # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default")))
     1363   # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break
     1364#   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")
     1365#   set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp)
     1366#   file(WRITE "${_source_file}" "${_source}")
     1367#   set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}")
     1368#   try_compile(_compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" OUTPUT_VARIABLE _compile_output_var)
     1369#   if(NOT _compile_result)
     1370#       message("${_compile_output_var}")
     1371#       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).")
     1372#   endif(NOT _compile_result)
     1373endif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     1374
     1375
     1376if (CMAKE_C_COMPILER MATCHES "icc")
     1377
     1378   set (KDE4_ENABLE_EXCEPTIONS -fexceptions)
     1379   # Select flags.
     1380   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
     1381   set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1382   set(CMAKE_CXX_FLAGS_DEBUG          "-O2 -g -fno-inline -noalign")
     1383   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g -fno-inline -noalign")
     1384   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g")
     1385   set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG -DQT_NO_DEBUG")
     1386   set(CMAKE_C_FLAGS_DEBUG            "-O2 -g -fno-inline -noalign")
     1387   set(CMAKE_C_FLAGS_DEBUGFULL        "-g -fno-inline -noalign")
     1388
     1389   set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -ansi -Wall -w1 -Wpointer-arith -fno-common")
     1390   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wall -w1 -Wpointer-arith -fno-exceptions -fno-common")
     1391
     1392   # visibility support
     1393   set(__KDE_HAVE_ICC_VISIBILITY)
     1394#   check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_ICC_VISIBILITY)
     1395#   if (__KDE_HAVE_ICC_VISIBILITY)
     1396#      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
     1397#   endif (__KDE_HAVE_ICC_VISIBILITY)
     1398
     1399endif (CMAKE_C_COMPILER MATCHES "icc")
     1400
     1401
     1402###########    end of platform specific stuff  ##########################
     1403
     1404
     1405# KDE4Macros.cmake contains all the KDE specific macros
     1406include(${kde_cmake_module_dir}/KDE4Macros.cmake)
     1407
     1408
     1409# decide whether KDE4 has been found
     1410set(KDE4_FOUND FALSE)
     1411if (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK)
     1412   set(KDE4_FOUND TRUE)
     1413   set(KDE4Internal_FOUND TRUE) # for feature_summary
     1414endif (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK)
     1415
     1416
     1417macro (KDE4_PRINT_RESULTS)
     1418
     1419   # inside kdelibs the include dir and lib dir are internal, not "found"
     1420   if (NOT _kdeBootStrapping)
     1421       if(KDE4_INCLUDE_DIR)
     1422          message(STATUS "Found KDE 4.12 include dir: ${KDE4_INCLUDE_DIR}")
     1423       else(KDE4_INCLUDE_DIR)
     1424          message(STATUS "ERROR: unable to find the KDE 4 headers")
     1425       endif(KDE4_INCLUDE_DIR)
     1426
     1427       if(KDE4_LIB_DIR)
     1428          message(STATUS "Found KDE 4.12 library dir: ${KDE4_LIB_DIR}")
     1429       else(KDE4_LIB_DIR)
     1430          message(STATUS "ERROR: unable to find the KDE 4 core library")
     1431       endif(KDE4_LIB_DIR)
     1432   endif (NOT _kdeBootStrapping)
     1433
     1434   if(KDE4_KCFGC_EXECUTABLE)
     1435      message(STATUS "Found the KDE4 kconfig_compiler preprocessor: ${KDE4_KCFGC_EXECUTABLE}")
     1436   else(KDE4_KCFGC_EXECUTABLE)
     1437      message(STATUS "Didn't find the KDE4 kconfig_compiler preprocessor")
     1438   endif(KDE4_KCFGC_EXECUTABLE)
     1439
     1440   if(AUTOMOC4_EXECUTABLE)
     1441      message(STATUS "Found automoc4: ${AUTOMOC4_EXECUTABLE}")
     1442   else(AUTOMOC4_EXECUTABLE)
     1443      message(STATUS "Didn't find automoc4")
     1444   endif(AUTOMOC4_EXECUTABLE)
     1445endmacro (KDE4_PRINT_RESULTS)
     1446
     1447
     1448if (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND)
     1449   #bail out if something wasn't found
     1450   kde4_print_results()
     1451   if (NOT KDE4_INSTALLED_VERSION_OK)
     1452     message(FATAL_ERROR "ERROR: the installed kdelibs version ${KDE_VERSION} is too old, at least version ${KDE_MIN_VERSION} is required")
     1453   endif (NOT KDE4_INSTALLED_VERSION_OK)
     1454
     1455   if (NOT KDE4_KCFGC_EXECUTABLE)
     1456     message(FATAL_ERROR "ERROR: could not detect a usable kconfig_compiler")
     1457   endif (NOT KDE4_KCFGC_EXECUTABLE)
     1458
     1459   message(FATAL_ERROR "ERROR: could NOT find everything required for compiling KDE 4 programs")
     1460endif (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND)
     1461
     1462if (NOT KDE4Internal_FIND_QUIETLY)
     1463   kde4_print_results()
     1464endif (NOT KDE4Internal_FIND_QUIETLY)
     1465
     1466#add the found Qt and KDE include directories to the current include path
     1467#the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include <KMainWindow>
     1468set(KDE4_INCLUDES
     1469   ${KDE4_INCLUDE_DIR}
     1470   ${KDE4_INCLUDE_DIR}/KDE
     1471   ${KDE4_PHONON_INCLUDES}
     1472   ${QT_INCLUDES}
     1473   ${_KDE4_PLATFORM_INCLUDE_DIRS}
     1474)
     1475
     1476# Used by kdebug.h: the "toplevel dir" is one level above CMAKE_SOURCE_DIR
     1477get_filename_component(_KDE4_CMAKE_TOPLEVEL_DIR "${CMAKE_SOURCE_DIR}/.." ABSOLUTE)
     1478string(LENGTH "${_KDE4_CMAKE_TOPLEVEL_DIR}" _KDE4_CMAKE_TOPLEVEL_DIR_LENGTH)
     1479
     1480set(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})
     1481
     1482if (NOT _kde4_uninstall_rule_created)
     1483   set(_kde4_uninstall_rule_created TRUE)
     1484
     1485   configure_file("${kde_cmake_module_dir}/kde4_cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY)
     1486
     1487   add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
     1488
     1489endif (NOT _kde4_uninstall_rule_created)
     1490
     1491endif(NOT KDE4_FOUND)
  • deleted file kde/kde4-workspace/files/no-oxygen-theme.patch

    diff --git a/kde/kde4-workspace/files/no-oxygen-theme.patch b/kde/kde4-workspace/files/no-oxygen-theme.patch
    deleted file mode 100644
    index 59a598348b..0000000000
    + -  
    1 --- kstyles/orig.CMakeLists.txt 2014-10-03 18:30:13.000000000 +0200
    2 +++ kstyles/CMakeLists.txt      2014-10-08 11:57:14.000000000 +0200
    3 @@ -1,2 +1,2 @@
    4 -add_subdirectory( oxygen )
    5 +# add_subdirectory( oxygen )
    6  add_subdirectory( themes )
    7 --- libs/oxy.CMakeLists.txt     2014-12-30 13:32:17.000000000 +0100
    8 +++ libs/CMakeLists.txt 2014-12-30 14:25:25.000000000 +0100
    9 @@ -1,6 +1,6 @@
    10  add_subdirectory(kephal)
    11  add_subdirectory(kworkspace)
    12 -add_subdirectory(oxygen)
    13 +#add_subdirectory(oxygen)
    14  add_subdirectory(plasmaclock)
    15  
    16  if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
  • kde/kde4-workspace/files/patch-CMakeLists-for-OSX.patch

    diff --git a/kde/kde4-workspace/files/patch-CMakeLists-for-OSX.patch b/kde/kde4-workspace/files/patch-CMakeLists-for-OSX.patch
    old mode 100644
    new mode 100755
    index 5b43f06622..a575402222
    a b  
    1 --- orig.CMakeLists.txt 2014-09-19 14:30:04.000000000 +0200
    2 +++ CMakeLists.txt      2014-10-03 18:55:38.000000000 +0200
    3 @@ -194,7 +194,7 @@
     1diff --git CMakeLists.txt CMakeLists.txt
     2index 3d4287c..273dcdd 100644
     3--- CMakeLists.txt
     4+++ CMakeLists.txt
     5@@ -19,6 +19,7 @@ find_package(KDE4 4.9.4 REQUIRED)
     6 include(KDE4Defaults)
     7 
     8 option(WITH_XINERAMA "Xinerama support for multi-headed X displays" ON)
     9+option(BUILD_OXYGEN "Build the Oxygen style for Qt4/KDE4" ON)
     10 
     11 find_package(Strigi)
     12 
     13@@ -194,7 +195,7 @@ set_package_properties(QJSON PROPERTIES DESCRIPTION "Library to manage JSON obje
    414 
    515 
    616 include(ConfigureChecks.cmake)
     
    919   configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h )
    1020   configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h )
    1121   if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
    12 @@ -221,15 +221,17 @@
     22@@ -221,15 +222,17 @@ endif(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    1323 
    1424 # core apps
    1525 if(NOT WIN32)
    1626-   macro_optional_add_subdirectory( kcheckpass )
    1727-   macro_optional_add_subdirectory( kwin )
    1828-   macro_optional_add_subdirectory( ksmserver )
    19 -
    20 -   find_package(JPEG REQUIRED)
    21 -   find_package(PNG REQUIRED)
    22 -   macro_optional_add_subdirectory( ksplash )
    2329+   if(NOT APPLE)
    2430+      macro_optional_add_subdirectory( kcheckpass )
    2531+      macro_optional_add_subdirectory( kwin )
    2632+      macro_optional_add_subdirectory( ksmserver )
    27 +
     33 
     34-   find_package(JPEG REQUIRED)
     35-   find_package(PNG REQUIRED)
     36-   macro_optional_add_subdirectory( ksplash )
    2837+      find_package(JPEG REQUIRED)
    2938+      find_package(PNG REQUIRED)
    3039+      macro_optional_add_subdirectory( ksplash )
     
    3544    macro_optional_add_subdirectory( qguiplatformplugin_kde )
    3645    if (NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    3746       macro_optional_add_subdirectory( ksysguard )
    38 @@ -238,14 +240,16 @@
     47@@ -238,14 +241,16 @@ endif(NOT WIN32)
    3948 
    4049 if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    4150    macro_optional_add_subdirectory(kcontrol)
     
    6069 
    6170    # data
    6271    macro_optional_add_subdirectory(doc)
    63 @@ -254,7 +258,7 @@
     72@@ -254,7 +259,7 @@ if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    6473       macro_optional_add_subdirectory(ktouchpadenabler)
    6574    endif (Q_WS_X11)
    6675 
     
    6978       macro_optional_add_subdirectory(kcminit)
    7079       macro_optional_add_subdirectory(khotkeys)
    7180       macro_optional_add_subdirectory(kwrited)
    72 @@ -269,17 +273,19 @@
     81@@ -269,17 +274,19 @@ if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    7382    endif(X11_Xau_FOUND AND X11_Xdmcp_FOUND)
    7483 endif(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    7584 
     
    8190 
    8291-macro_optional_add_subdirectory(plasma)
    8392+if(NOT APPLE)
    84 +   macro_optional_add_subdirectory(plasma)
    85 +endif(NOT APPLE)
     93+    macro_optional_add_subdirectory(plasma)
     94+endif()
    8695 macro_optional_add_subdirectory(statusnotifierwatcher)
    8796 macro_optional_add_subdirectory(kstyles)
    8897 
     
    92101   install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startkde DESTINATION ${BIN_INSTALL_DIR})
    93102 endif(NOT WIN32)
    94103 
     104@@ -352,9 +359,11 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/KDE4WorkspaceConfig.cmake
     105               ${CMAKE_CURRENT_BINARY_DIR}/KDE4WorkspaceConfigVersion.cmake
     106         DESTINATION ${_KDE4WorkspaceConfig_INSTALL_DIR})
     107 
     108-install(EXPORT kdeworkspaceLibraryTargets
     109+if(NOT APPLE)
     110+    install(EXPORT kdeworkspaceLibraryTargets
     111         NAMESPACE ${KDE4WORKSPACE_TARGET_PREFIX}
     112         DESTINATION ${_KDE4WorkspaceConfig_INSTALL_DIR}
     113         FILE KDE4WorkspaceLibraryTargets.cmake )
     114+endif()
     115 
     116 
     117diff --git libs/CMakeLists.txt libs/CMakeLists.txt
     118index c0576fe6e77eedd71ec548c8cf38dda819dfaa99..0f522ab59b1928d1e63f561b3b98e06d4d703910 100644
     119--- libs/CMakeLists.txt
     120+++ libs/CMakeLists.txt
     121@@ -1,19 +1,20 @@
     122-add_subdirectory(kephal)
     123-add_subdirectory(kworkspace)
     124-add_subdirectory(oxygen)
     125-add_subdirectory(plasmaclock)
     126+if(NOT APPLE)
     127+    add_subdirectory(kephal)
     128+    add_subdirectory(kworkspace)
     129+    add_subdirectory(plasmaclock)
     130 
     131-if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
     132-   add_subdirectory(kdm)
     133-   add_subdirectory(plasmagenericshell)
     134-   if(NOT WIN32)
     135-        add_subdirectory(taskmanager)
     136-   endif(NOT WIN32)
     137-endif(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
     138+    if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
     139+       add_subdirectory(kdm)
     140+       add_subdirectory(plasmagenericshell)
     141+       if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     142+            add_subdirectory(taskmanager)
     143+       endif(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     144+    endif(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
     145 
     146-if(NOT WIN32)
     147-    if (NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     148+    if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     149         add_subdirectory(ksysguard)
     150-    endif (NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     151-endif(NOT WIN32)
     152-
     153+    endif(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
     154+endif()
     155+if(BUILD_OXYGEN)
     156+    add_subdirectory(oxygen)
     157+endif()
     158diff --git kstyles/CMakeLists.txt kstyles/CMakeLists.txt
     159index 260f65b784121c3455e1a3e129d92fe37f30d12b..34585c6e46be2fb465f1cce9a41f63e42f2d05fb 100644
     160--- kstyles/CMakeLists.txt
     161+++ kstyles/CMakeLists.txt
     162@@ -1,2 +1,4 @@
     163-add_subdirectory( oxygen )
     164+if(BUILD_OXYGEN)
     165+    add_subdirectory( oxygen )
     166+endif()
     167 add_subdirectory( themes )
  • new file kde/kde4-workspace/files/patch-input-wheelzooms.diff

    diff --git a/kde/kde4-workspace/files/patch-input-wheelzooms.diff b/kde/kde4-workspace/files/patch-input-wheelzooms.diff
    new file mode 100644
    index 0000000000..c3035ca700
    - +  
     1diff --git kcontrol/input/kmousedlg.ui kcontrol/input/kmousedlg.ui
     2index b48a606..c2dde85 100644
     3--- kcontrol/input/kmousedlg.ui
     4+++ kcontrol/input/kmousedlg.ui
     5@@ -76,6 +76,16 @@
     6          </property>
     7         </widget>
     8        </item>
     9+       <item>
     10+        <widget class="QCheckBox" name="cbWheelZooms">
     11+         <property name="whatsThis">
     12+          <string>Scrolling with the mouse wheel with the Control (or Command) key may zoom text, or else may accelerate the scrolling.</string>
     13+         </property>
     14+         <property name="text">
     15+          <string>Mo&amp;use wheel may zoom text</string>
     16+         </property>
     17+        </widget>
     18+       </item>
     19       </layout>
     20      </item>
     21      <item>
     22@@ -249,6 +259,7 @@
     23   <tabstop>rightHanded</tabstop>
     24   <tabstop>leftHanded</tabstop>
     25   <tabstop>cbScrollPolarity</tabstop>
     26+  <tabstop>cbWheelZooms</tabstop>
     27   <tabstop>doubleClick</tabstop>
     28   <tabstop>singleClick</tabstop>
     29   <tabstop>cb_pointershape</tabstop>
     30diff --git kcontrol/input/mouse.cpp kcontrol/input/mouse.cpp
     31index cebb174..d65db1c 100644
     32--- kcontrol/input/mouse.cpp
     33+++ kcontrol/input/mouse.cpp
     34@@ -180,6 +180,9 @@ MouseConfig::MouseConfig(QWidget *parent, const QVariantList &args)
     35     connect(generalTab->cbScrollPolarity, SIGNAL(clicked()), this, SLOT(changed()));
     36     connect(generalTab->cbScrollPolarity, SIGNAL(clicked()), this, SLOT(slotScrollPolarityChanged()));
     37 
     38+    connect(generalTab->cbWheelZooms, SIGNAL(clicked()), this, SLOT(changed()));
     39+    connect(generalTab->cbWheelZooms, SIGNAL(clicked()), this, SLOT(slotWheelZoomsChanged()));
     40+
     41     // Advanced tab
     42     advancedTab = new QWidget(0);
     43     advancedTab->setObjectName("Advanced Tab");
     44@@ -457,6 +460,7 @@ void MouseConfig::load()
     45   if ( generalTab->cbScrollPolarity->isEnabled() )
     46     generalTab->cbScrollPolarity->setEnabled(settings->handedEnabled);
     47   generalTab->cbScrollPolarity->setChecked( settings->reverseScrollPolarity );
     48+  generalTab->cbWheelZooms->setChecked( settings->wheelZooms );
     49 
     50   setAccel(settings->accelRate);
     51   setThreshold(settings->thresholdMove);
     52@@ -524,6 +528,7 @@ void MouseConfig::save()
     53 //  settings->changeCursor = generalTab->singleClick->isChecked();
     54   settings->changeCursor = generalTab->cb_pointershape->isChecked();
     55   settings->reverseScrollPolarity = generalTab->cbScrollPolarity->isChecked();
     56+  settings->wheelZooms = generalTab->cbWheelZooms->isChecked();
     57 
     58   settings->apply();
     59   KConfig config( "kcminputrc" );
     60@@ -568,6 +573,7 @@ void MouseConfig::defaults()
     61     generalTab->slAutoSelect->setValue( KDE_DEFAULT_AUTOSELECTDELAY == -1 ? 50 : KDE_DEFAULT_AUTOSELECTDELAY );
     62     generalTab->singleClick->setChecked( KDE_DEFAULT_SINGLECLICK );
     63     generalTab->cb_pointershape->setChecked(KDE_DEFAULT_CHANGECURSOR);
     64+    generalTab->cbWheelZooms->setChecked(KDE_DEFAULT_WHEEL_ZOOM);
     65     slotClick();
     66 
     67   mouseKeys->setChecked(false);
     68@@ -681,6 +687,7 @@ void MouseSettings::load(KConfig *config)
     69   singleClick = group.readEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
     70   autoSelectDelay = group.readEntry("AutoSelectDelay", KDE_DEFAULT_AUTOSELECTDELAY);
     71   changeCursor = group.readEntry("ChangeCursor", KDE_DEFAULT_CHANGECURSOR);
     72+  wheelZooms = group.readEntry("WheelMouseZooms", KDE_DEFAULT_WHEEL_ZOOM );
     73 }
     74 
     75 void MouseConfig::slotThreshChanged(int value)
     76@@ -796,6 +803,7 @@ void MouseSettings::save(KConfig *config)
     77   group.writeEntry("SingleClick", singleClick, KConfig::Persistent|KConfig::Global);
     78   group.writeEntry("AutoSelectDelay", autoSelectDelay, KConfig::Persistent|KConfig::Global);
     79   group.writeEntry("ChangeCursor", changeCursor,KConfig::Persistent|KConfig::Global);
     80+  group.writeEntry("WheelMouseZooms", wheelZooms, KConfig::Persistent|KConfig::Global);
     81   // This iterates through the various Logitech mice, if we have support.
     82 #ifdef HAVE_LIBUSB
     83   LogitechMouse *logitechMouse;
     84@@ -812,6 +820,11 @@ void MouseConfig::slotScrollPolarityChanged()
     85   settings->m_handedNeedsApply = true;
     86 }
     87 
     88+void MouseConfig::slotWheelZoomsChanged()
     89+{
     90+  settings->wheelZooms = generalTab->cbWheelZooms->isChecked();
     91+}
     92+
     93 void MouseConfig::slotSmartSliderEnabling()
     94 {
     95   bool enabled = generalTab->singleClick->isChecked() ? generalTab->cbAutoSelect->isChecked() : false;
     96diff --git kcontrol/input/mouse.h kcontrol/input/mouse.h
     97index d926a99..dcc160f 100644
     98--- kcontrol/input/mouse.h
     99+++ kcontrol/input/mouse.h
     100@@ -88,6 +88,7 @@ public:
     101  bool changeCursor;
     102  int wheelScrollLines;
     103  bool reverseScrollPolarity;
     104+ bool wheelZooms;
     105 
     106  #ifdef HAVE_LIBUSB
     107  // TODO: In Qt4, replace with a better container.
     108@@ -112,6 +113,7 @@ private Q_SLOTS:
     109   /** No descriptions */
     110   void slotHandedChanged(int val);
     111   void slotScrollPolarityChanged();
     112+  void slotWheelZoomsChanged();
     113   void checkAccess();
     114   void slotThreshChanged(int value);
     115   void slotDragStartDistChanged(int value);
  • deleted file kde/kde4-workspace/files/patch-libs-CMakeLists.patch

    diff --git a/kde/kde4-workspace/files/patch-libs-CMakeLists.patch b/kde/kde4-workspace/files/patch-libs-CMakeLists.patch
    deleted file mode 100644
    index 10d5a027e8..0000000000
    + -  
    1 diff --git libs/CMakeLists.txt libs/CMakeLists.txt
    2 index c0576fe..1a34bca 100644
    3 --- libs/CMakeLists.txt
    4 +++ libs/CMakeLists.txt
    5 @@ -6,14 +6,12 @@ add_subdirectory(plasmaclock)
    6  if(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    7     add_subdirectory(kdm)
    8     add_subdirectory(plasmagenericshell)
    9 -   if(NOT WIN32)
    10 +   if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    11          add_subdirectory(taskmanager)
    12 -   endif(NOT WIN32)
    13 +   endif(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    14  endif(${KDE_PLATFORM_PROFILE} STREQUAL "Desktop")
    15  
    16 -if(NOT WIN32)
    17 -    if (NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    18 -        add_subdirectory(ksysguard)
    19 -    endif (NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    20 -endif(NOT WIN32)
    21 +if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    22 +    add_subdirectory(ksysguard)
    23 +endif(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES Darwin)
    24  
    25