From baf774783ced0a2290300c364f5d76afecfe9598 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 2 Mar 2021 22:08:04 +0200 Subject: [PATCH] generic: add feature information about found X11 extensions Signed-off-by: Ivailo Monev --- CMakeLists.txt | 16 +++++++++----- ConfigureChecks.cmake | 21 +++++++------------ config-X11.h.cmake | 3 +++ krunner/CMakeLists.txt | 8 ++----- .../ksysguardd/config-ksysguardd.h.cmake | 1 - libs/ksysguard/CMakeLists.txt | 13 +----------- libs/ksysguard/config-ksysguard.h.cmake | 3 --- libs/ksysguard/processui/ProcessModel_p.h | 1 + .../processui/ksysguardprocesslist.cpp | 1 + 9 files changed, 26 insertions(+), 41 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc40f61d..c363a558 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,6 @@ include(GenerateExportHeader) find_package(KDE4 4.19.0 REQUIRED) include(KDE4Defaults) -option(WITH_XINERAMA "Xinerama support for multi-headed X displays" ON) - find_package(ZLIB) set_package_properties(ZLIB PROPERTIES DESCRIPTION "Support for gzip compressed files and data streams" @@ -83,10 +81,18 @@ if(Q_WS_X11) TYPE REQUIRED ) - add_feature_info("Automated testing of X clients" X11_XTest_FOUND - "The X11 Testing Resource extension library is useful for automated testing of X clients") + add_feature_info("libXTest" X11_XTest_FOUND "The X11 Testing Resource extension library is useful for automated testing of X clients") add_feature_info("libXau" X11_Xau_FOUND "The X11 Authorization Protocol library may be used by KDM") - add_feature_info("LibXdmcp" X11_Xdmcp_FOUND "The X Display Manager Control Protocol library may be used by KDM") + add_feature_info("libXdmcp" X11_Xdmcp_FOUND "The X Display Manager Control Protocol library may be used by KDM") + add_feature_info("libXcomposite" X11_Xcomposite_FOUND "The X11 Composite extension library may be used by Plasma and KWin") + add_feature_info("libXShm" X11_XShm_FOUND "The X11 shared-memory fences library may be used by ksplash") + add_feature_info("libxf86misc" X11_xf86misc_FOUND "The X11 miscellaneous library may be used by keyboard KCM") # TODO: unused? + add_feature_info("libdpms" X11_dpms_FOUND "The X11 extension library may be used by powerdevil") + add_feature_info("libXSync" X11_XSync_FOUND "The X11 synchronization may be used by KWin") + add_feature_info("libXinput" X11_Xinput_FOUND "The X11 XINPUT extension library may be used by keyboard KCM") + add_feature_info("libXft" X11_Xft_FOUND "The X11 font API library may be used by kfontinst KCM") + add_feature_info("libXinerama" X11_Xinerama_FOUND "The X11 XINERAMA extension library may be used by ksplash") + add_feature_info("libXRes" X11_XRes_FOUND "The X Resource library may be used by ksysguard") if(NOT X11_Xdamage_FOUND) message(FATAL_ERROR "The X11 damaged region extension library was not found. Required for compositing support in KWin.") diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6ec6cf8d..dbecd022 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -68,27 +68,20 @@ check_include_files(unistd.h HAVE_UNISTD_H) check_include_files(malloc.h HAVE_MALLOC_H) macro_bool_to_01(FONTCONFIG_FOUND HAVE_FONTCONFIG) # kcontrol/{fonts,kfontinst} macro_bool_to_01(FREETYPE_FOUND HAVE_FREETYPE) # kcontrol/fonts -macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM) # kwin, ksplash +macro_bool_to_01(X11_XShm_FOUND HAVE_XSHM) # ksplash macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST) # khotkeys, kxkb, kdm -macro_bool_to_01(X11_Xcomposite_FOUND HAVE_XCOMPOSITE) # kicker, kwin +macro_bool_to_01(X11_Xcomposite_FOUND HAVE_XCOMPOSITE) # plasma, kwin macro_bool_to_01(X11_Xcursor_FOUND HAVE_XCURSOR) # many uses macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE) # kwin macro_bool_to_01(X11_Xfixes_FOUND HAVE_XFIXES) # klipper, kicker, kwin -if(X11_Xkbfile_FOUND) - macro_bool_to_01(X11_Xkb_FOUND HAVE_XKB) # kdm, kglobalaccel, kcontrol/keyboard -else() - set(X11_Xkb_FOUND 0) -endif() -if(WITH_XINERAMA) - macro_bool_to_01(X11_Xinerama_FOUND HAVE_XINERAMA) -else(WITH_XINERAMA) - set(HAVE_XINERAMA 0) -endif(WITH_XINERAMA) +macro_bool_to_01(X11_Xkb_FOUND HAVE_XKB) # kdm, kglobalaccel, kcontrol/keyboard +macro_bool_to_01(X11_Xinerama_FOUND HAVE_XINERAMA) macro_bool_to_01(X11_Xrandr_FOUND HAVE_XRANDR) # kwin macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER) # kcontrol/style, kicker -macro_bool_to_01(X11_xf86misc_FOUND HAVE_XF86MISC) # kdesktop and kcontrol/lock -macro_bool_to_01(X11_dpms_FOUND HAVE_DPMS) # kdesktop +macro_bool_to_01(X11_xf86misc_FOUND HAVE_XF86MISC) # kcontrol/keyboard +macro_bool_to_01(X11_dpms_FOUND HAVE_DPMS) # powerdevil macro_bool_to_01(X11_XSync_FOUND HAVE_XSYNC) # kwin +macro_bool_to_01(X11_XRes_FOUND HAVE_XRES) # ksysguard check_function_exists(setpriority HAVE_SETPRIORITY) # kscreenlocker diff --git a/config-X11.h.cmake b/config-X11.h.cmake index 2f16eb5d..ef861d8a 100644 --- a/config-X11.h.cmake +++ b/config-X11.h.cmake @@ -36,3 +36,6 @@ /* Define if you have XRandR 1.3 */ #cmakedefine HAS_RANDR_1_3 1 + +/* Define if you have the XRes extension */ +#cmakedefine HAVE_XRES 1 diff --git a/krunner/CMakeLists.txt b/krunner/CMakeLists.txt index e39abd27..ed0665ce 100644 --- a/krunner/CMakeLists.txt +++ b/krunner/CMakeLists.txt @@ -65,13 +65,9 @@ target_link_libraries(krunner ${X11_LIBRARIES} ) -if(X11_Xsreensaver_FOUND) - target_link_libraries(krunner ${X11_Xsreensaver_LIB}) -endif(X11_Xsreensaver_FOUND) - if(X11_Xcursor_FOUND) - target_link_libraries(krunner ${X11_Xcursor_LIB}) -endif(X11_Xcursor_FOUND) + target_link_libraries(krunner ${X11_Xcursor_LIB}) +endif() install(TARGETS krunner ${INSTALL_TARGETS_DEFAULT_ARGS} ) diff --git a/ksysguard/ksysguardd/config-ksysguardd.h.cmake b/ksysguard/ksysguardd/config-ksysguardd.h.cmake index a0c4a539..2c576507 100644 --- a/ksysguard/ksysguardd/config-ksysguardd.h.cmake +++ b/ksysguard/ksysguardd/config-ksysguardd.h.cmake @@ -1,2 +1 @@ #cmakedefine HAVE_LMSENSORS 1 -#cmakedefine HAVE_XRES 1 diff --git a/libs/ksysguard/CMakeLists.txt b/libs/ksysguard/CMakeLists.txt index 1af2ee8a..10c193ee 100644 --- a/libs/ksysguard/CMakeLists.txt +++ b/libs/ksysguard/CMakeLists.txt @@ -1,18 +1,7 @@ +configure_file(config-ksysguard.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksysguard.h) ########### next target ############### -if(Q_WS_X11) - find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH}) - find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH}) - - if(X11_XRes_LIB AND X11_XRes_INCLUDE_PATH) - set(X11_XRes_FOUND TRUE) - endif(X11_XRes_LIB AND X11_XRes_INCLUDE_PATH) -endif(Q_WS_X11) - -macro_bool_to_01(X11_XRes_FOUND HAVE_XRES) -configure_file(config-ksysguard.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksysguard.h ) - add_subdirectory( lsofui ) add_subdirectory( processcore ) add_subdirectory( processui ) diff --git a/libs/ksysguard/config-ksysguard.h.cmake b/libs/ksysguard/config-ksysguard.h.cmake index 670fb8de..bf3ea121 100644 --- a/libs/ksysguard/config-ksysguard.h.cmake +++ b/libs/ksysguard/config-ksysguard.h.cmake @@ -7,6 +7,3 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_BYTESWAP_H 1 -/* Define to 1 if you have the X11 xres file */ -#cmakedefine HAVE_XRES 1 - diff --git a/libs/ksysguard/processui/ProcessModel_p.h b/libs/ksysguard/processui/ProcessModel_p.h index 4918e51b..9f32cbc1 100644 --- a/libs/ksysguard/processui/ProcessModel_p.h +++ b/libs/ksysguard/processui/ProcessModel_p.h @@ -56,6 +56,7 @@ struct WindowInfo { QString name; }; #include "../config-ksysguard.h" +#include "config-X11.h" #endif namespace KSysGuard { class Processes; } diff --git a/libs/ksysguard/processui/ksysguardprocesslist.cpp b/libs/ksysguard/processui/ksysguardprocesslist.cpp index 6853977d..d48fe4ca 100644 --- a/libs/ksysguard/processui/ksysguardprocesslist.cpp +++ b/libs/ksysguard/processui/ksysguardprocesslist.cpp @@ -25,6 +25,7 @@ #include "ksysguardprocesslist.h" #include "../config-ksysguard.h" +#include "config-X11.h" #include #include