Git commit 060c93233ea862b032b05390e6bb1d69781dac3d by Martin Gr=C3=A4=C3= =9Flin. Committed on 11/06/2014 at 05:51. Pushed by graesslin into branch 'master'. Make xcb-icccm truely optional ICCCM dependency is a beast due to two different existing versions in different packages. Thus it cannot be a hard dep without causing problems for our downstreams. This change ensures that ICCCM is really considered as an optional dep and that the version we need is found, if not we mark it as non-found. ICCCM is only used by one test application which can easily be disabled and some enum values are used in events.cpp. If ICCCM is not found those are replaced by defines generated in config-kwin.h. BUG: 336035 M +19 -14 CMakeLists.txt M +7 -0 config-kwin.h.cmake M +2 -0 events.cpp http://commits.kde.org/kwin/060c93233ea862b032b05390e6bb1d69781dac3d diff --git a/CMakeLists.txt b/CMakeLists.txt index 60d3c66..5351236 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,24 +138,29 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X1= 1 libraries" ) = # All the required XCB components -find_package(XCB REQUIRED COMPONENTS - XCB - XFIXES - DAMAGE - COMPOSITE - SHAPE - SYNC - RENDER - RANDR - KEYSYMS - IMAGE - SHM - XTEST +find_package(XCB + REQUIRED COMPONENTS + XCB + XFIXES + DAMAGE + COMPOSITE + SHAPE + SYNC + RENDER + RANDR + KEYSYMS + IMAGE + SHM + XTEST + OPTIONAL_COMPONENTS + ICCCM ) set_package_properties(XCB PROPERTIES TYPE REQUIRED) = # and the optional XCB dependencies -find_package(XCB COMPONENTS ICCCM) +if (XCB_ICCCM_VERSION VERSION_LESS "0.4") + set(XCB_ICCCM_FOUND FALSE) +endif() add_feature_info("XCB-ICCCM" XCB_ICCCM_FOUND "Required for building test a= pplications for KWin") = feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_= PACKAGES) diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake index d9bf15e..67aba7b 100644 --- a/config-kwin.h.cmake +++ b/config-kwin.h.cmake @@ -17,3 +17,10 @@ = /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MALLOC_H 1 + +#cmakedefine XCB_ICCCM_FOUND 1 +#ifndef XCB_ICCCM_FOUND +#define XCB_ICCCM_WM_STATE_WITHDRAWN 0 +#define XCB_ICCCM_WM_STATE_NORMAL 1 +#define XCB_ICCCM_WM_STATE_ICONIC 3 +#endif diff --git a/events.cpp b/events.cpp index cb2aeac..d84e09d 100644 --- a/events.cpp +++ b/events.cpp @@ -54,7 +54,9 @@ along with this program. If not, see . #include = #include +#ifdef XCB_ICCCM_FOUND #include +#endif = #include "composite.h" #include "killwindow.h"