diff --git a/kcms/lookandfeel/CMakeLists.txt b/kcms/lookandfeel/CMakeLists.txt --- a/kcms/lookandfeel/CMakeLists.txt +++ b/kcms/lookandfeel/CMakeLists.txt @@ -1,17 +1,25 @@ # KI18N Translation Domain for this library add_definitions(-DTRANSLATION_DOMAIN=\"kcm_lookandfeel\") +if(X11_Xcursor_FOUND) + set(HAVE_XCURSOR TRUE) +endif() configure_file (config-kcm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcm.h ) - set(kcm_lookandfeel_SRCS - kcmmain.cpp - kcm.cpp - ../krdb/krdb.cpp - ../cursortheme/xcursor/cursortheme.cpp - ../cursortheme/xcursor/xcursortheme.cpp + kcmmain.cpp + kcm.cpp + ../krdb/krdb.cpp ) +if (X11_Xcursor_FOUND) + set(kcm_lookandfeel_SRCS + ${kcm_lookandfeel_SRCS} + ../cursortheme/xcursor/cursortheme.cpp + ../cursortheme/xcursor/xcursortheme.cpp + ) +endif () + set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml) qt5_add_dbus_interface(kcm_lookandfeel_SRCS ${klauncher_xml} klauncher_iface) @@ -69,10 +77,16 @@ # TODO: load kcm plugin instead of using code copy kcm.cpp ../krdb/krdb.cpp - ../cursortheme/xcursor/cursortheme.cpp - ../cursortheme/xcursor/xcursortheme.cpp ) +if (X11_Xcursor_FOUND) + set(lookandfeeltool_SRCS + ${lookandfeeltool_SRCS} + ../cursortheme/xcursor/cursortheme.cpp + ../cursortheme/xcursor/xcursortheme.cpp + ) +endif () + qt5_add_dbus_interface(lookandfeeltool_SRCS ${klauncher_xml} klauncher_iface) kconfig_add_kcfg_files(lookandfeeltool_SRCS lookandfeelsettings.kcfgc GENERATE_MOC) diff --git a/kcms/lookandfeel/autotests/CMakeLists.txt b/kcms/lookandfeel/autotests/CMakeLists.txt --- a/kcms/lookandfeel/autotests/CMakeLists.txt +++ b/kcms/lookandfeel/autotests/CMakeLists.txt @@ -6,10 +6,16 @@ kcmtest.cpp ../kcm.cpp ../../krdb/krdb.cpp - ../../cursortheme/xcursor/cursortheme.cpp - ../../cursortheme/xcursor/xcursortheme.cpp ) +if (X11_Xcursor_FOUND) + set(kcmTest_SRCS + ${kcmTest_SRCS} + ../../cursortheme/xcursor/cursortheme.cpp + ../../cursortheme/xcursor/xcursortheme.cpp + ) +endif () + set(klauncher_xml ${KINIT_DBUS_INTERFACES_DIR}/kf5_org.kde.KLauncher.xml) qt5_add_dbus_interface(kcmTest_SRCS ${klauncher_xml} klauncher_iface) diff --git a/kcms/lookandfeel/config-kcm.h.cmake b/kcms/lookandfeel/config-kcm.h.cmake --- a/kcms/lookandfeel/config-kcm.h.cmake +++ b/kcms/lookandfeel/config-kcm.h.cmake @@ -1,2 +1,3 @@ #cmakedefine HAVE_XFIXES 1 - +#cmakedefine HAVE_XCURSOR 1 +#cmakedefine HAVE_BREEZE_DECO 1 diff --git a/kcms/lookandfeel/kcm.cpp b/kcms/lookandfeel/kcm.cpp --- a/kcms/lookandfeel/kcm.cpp +++ b/kcms/lookandfeel/kcm.cpp @@ -20,7 +20,6 @@ #include "kcm.h" #include "../krdb/krdb.h" -#include "../cursortheme/xcursor/xcursortheme.h" #include "config-kcm.h" #include "config-workspace.h" #include @@ -45,10 +44,14 @@ #include #include -#include #include "lookandfeelsettings.h" +#ifdef HAVE_XCURSOR +# include "../cursortheme/xcursor/xcursortheme.h" +# include +#endif + #ifdef HAVE_XFIXES # include #endif @@ -467,10 +470,11 @@ cg.writeEntry("cursorTheme", themeName); cg.sync(); +#ifdef HAVE_XCURSOR // Require the Xcursor version that shipped with X11R6.9 or greater, since // in previous versions the Xfixes code wasn't enabled due to a bug in the // build system (freedesktop bug #975). -#if HAVE_XFIXES && XFIXES_MAJOR >= 2 && XCURSOR_LIB_VERSION >= 10105 +#if defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2 && XCURSOR_LIB_VERSION >= 10105 const int cursorSize = cg.readEntry("cursorSize", 0); QDir themeDir = cursorThemeDir(themeName, 0); @@ -526,6 +530,7 @@ i18n("You have to restart the Plasma session for these changes to take effect."), i18n("Cursor Settings Changed"), "CursorSettingsChanged"); #endif +#endif } QDir KCMLookandFeel::cursorThemeDir(const QString &theme, const int depth) @@ -579,6 +584,7 @@ if (!m_cursorSearchPaths.isEmpty()) return m_cursorSearchPaths; +#ifdef HAVE_XCURSOR #if XCURSOR_LIB_MAJOR == 1 && XCURSOR_LIB_MINOR < 1 // These are the default paths Xcursor will scan for cursor themes QString path("~/.icons:/usr/share/icons:/usr/share/pixmaps:/usr/X11R6/lib/X11/icons"); @@ -609,6 +615,9 @@ // Expand all occurrences of ~/ to the home dir m_cursorSearchPaths.replaceInStrings(QRegExp(QStringLiteral("^~\\/")), QDir::home().path() + QLatin1Char('/')); return m_cursorSearchPaths; +#else + return QStringList(); +#endif } void KCMLookandFeel::setSplashScreen(const QString &theme)