From 498512c819c40289f590ebd9fae175662944de94 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 10 Jul 2016 03:03:15 +0300 Subject: [PATCH] setup X11 related definitions from the top-level CMake file Signed-off-by: Ivailo Monev --- CMakeLists.txt | 20 ++++++++++++++++++++ src/gui/CMakeLists.txt | 15 +-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8ea913f7..ba824edbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -566,6 +566,26 @@ if(NOT WITH_TIFF OR NOT TIFF_FOUND) katie_definition(-DQT_NO_IMAGEFORMAT_TIFF) endif() +# keep in sync with the gui component CMake file, only definitions setup is needed here +if(WITH_X11 AND X11_FOUND) + # TODO: xim + foreach(x11ext Xshape Xinerama Xrandr Xrender XSync Xkb Xfixes Xcursor Xinput XShm) + if(NOT X11_${x11ext}_FOUND) + message(WARNING "The X11 ${x11ext} extension was not found") + string(TOUPPER "${x11ext}" upperext) + katie_definition(-DQT_NO_${upperext}) + endif() + endforeach() + if(NOT X11_Xinput_FOUND) + message(WARNING "X11 Xinput extension was not found thus disabling tabled support too") + katie_definition(-DQT_NO_TABLET) + endif() + if(NOT X11_SM_FOUND) + message(WARNING "X11 SM was not found thus disabling session manager support") + katie_definition(-DQT_NO_SESSIONMANAGER) + endif() +endif() + # semi-shared include(src/shared/linguist/linguist.cmake) include(src/shared/bootstrap.cmake) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 433ae311b..e12a66504 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -450,6 +450,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/core/tools ) +# keep in sync with the top-level CMake file, only libraries setup is needed here if(WITH_X11 AND X11_FOUND) set(EXTRA_GUI_LIBS ${EXTRA_GUI_LIBS} @@ -459,8 +460,6 @@ if(WITH_X11 AND X11_FOUND) ${X11_Xi_LIB} ) include_directories(${X11_INCLUDE_DIR}) - # in case those may be usefull via KATIE_DEFINITIONS the checks will have to - # be moved to the top-level CMake file # TODO: xim foreach(x11ext Xshape Xinerama Xrandr Xrender XSync Xkb Xfixes Xcursor Xinput XShm) if(X11_${x11ext}_FOUND) @@ -468,20 +467,8 @@ if(WITH_X11 AND X11_FOUND) ${EXTRA_GUI_LIBS} ${X11_${x11ext}_LIB} ) - else() - message(WARNING "The X11 ${x11ext} extension was not found") - string(TOUPPER "${x11ext}" upperext) - add_definitions(-DQT_NO_${upperext}) endif() endforeach() - if(NOT X11_Xinput_FOUND) - message(WARNING "X11 Xinput extension was not found thus disabling tabled support too") - add_definitions(-DQT_NO_TABLET) - endif() - if(NOT X11_SM_FOUND) - message(WARNING "X11 SM was not found thus disabling session manager support") - add_definitions(-DQT_NO_SESSIONMANAGER) - endif() endif() if(WITH_NIS AND NIS_FOUND)