[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace] /: Remove the need of having a global HAVE_X11 variable
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2014-03-20 17:33:56
Message-ID: E1WQgqq-000343-3V () scm ! kde ! org
[Download RAW message or body]

Git commit 14e5089024e2fec26836ebb39cd00751895c9a37 by Aleix Pol.
Committed on 20/03/2014 at 15:58.
Pushed by apol into branch 'master'.

Remove the need of having a global HAVE_X11 variable

Use the standard X11_FOUND instead
Also properly set the HAVE_X11 value, since it's checked with #if HAVE_X11
instead of #ifdef.

M  +1    -2    CMakeLists.txt
M  +1    -1    kstyles/themes/CMakeLists.txt
M  +0    -1    kwin/CMakeLists.txt
M  +2    -2    plasma-desktop/kcms/colors/CMakeLists.txt
M  +3    -3    plasma-desktop/kcms/fonts/CMakeLists.txt
M  +2    -2    plasma-desktop/kcms/input/CMakeLists.txt
M  +1    -1    plasma-desktop/kcms/style/CMakeLists.txt
M  +1    -1    plasma-workspace/klipper/CMakeLists.txt
M  +3    -4    plasma-workspace/krunner/CMakeLists.txt
M  +2    -2    plasma-workspace/libkworkspace/CMakeLists.txt
M  +1    -1    plasma-workspace/libtaskmanager/CMakeLists.txt

http://commits.kde.org/kde-workspace/14e5089024e2fec26836ebb39cd00751895c9a37

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78e7b36..a5e4c58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,7 +115,6 @@ set_package_properties(XKB PROPERTIES
 
 
 find_package(X11)
-set (HAVE_X11 ${X11_FOUND})
 
 set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
                         URL "http://www.x.org"
@@ -123,7 +122,7 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
                         PURPOSE "Required for building the X11 based workspace"
                     )
 
-if(HAVE_X11)
+if(X11_FOUND)
   find_package(XCB REQUIRED COMPONENTS XCB XFIXES DAMAGE COMPOSITE SHAPE SYNC RENDER \
RANDR KEYSYMS IMAGE SHM XTEST)  set_package_properties(XCB PROPERTIES TYPE REQUIRED)
   find_package(XCB COMPONENTS ICCCM)
diff --git a/kstyles/themes/CMakeLists.txt b/kstyles/themes/CMakeLists.txt
index fd0b496..5e02828 100644
--- a/kstyles/themes/CMakeLists.txt
+++ b/kstyles/themes/CMakeLists.txt
@@ -7,7 +7,7 @@ set( themes_RC
     qtwindows.themerc
 )
 
-if (HAVE_X11)
+if (X11_FOUND)
   set( themes_RC ${themes_RC}
       qtgtk.themerc
   )
diff --git a/kwin/CMakeLists.txt b/kwin/CMakeLists.txt
index 3807b20..b8a10b3 100644
--- a/kwin/CMakeLists.txt
+++ b/kwin/CMakeLists.txt
@@ -113,7 +113,6 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
                         URL "http://www.x.org"
                         TYPE REQUIRED
                     )
-set(HAVE_X11 ${X11_FOUND})
 
 # All the required XCB components
 find_package(XCB REQUIRED COMPONENTS
diff --git a/plasma-desktop/kcms/colors/CMakeLists.txt \
b/plasma-desktop/kcms/colors/CMakeLists.txt index cfc2bea..ff0b537 100644
--- a/plasma-desktop/kcms/colors/CMakeLists.txt
+++ b/plasma-desktop/kcms/colors/CMakeLists.txt
@@ -16,8 +16,8 @@ target_link_libraries(kcm_colors
     KF5::KDE4Support
     ${X11_LIBRARIES})
 
-if(HAVE_X11)
-    set_target_properties(kcm_colors PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+if(X11_FOUND)
+    set_target_properties(kcm_colors PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
     target_link_libraries(kcm_colors Qt5::X11Extras)
 endif()
 
diff --git a/plasma-desktop/kcms/fonts/CMakeLists.txt \
b/plasma-desktop/kcms/fonts/CMakeLists.txt index 2e8768e..f1a800a 100644
--- a/plasma-desktop/kcms/fonts/CMakeLists.txt
+++ b/plasma-desktop/kcms/fonts/CMakeLists.txt
@@ -7,7 +7,7 @@ include_directories(${FREETYPE_INCLUDE_DIRS})
 
 set(kcm_fonts_PART_SRCS ../krdb/krdb.cpp fonts.cpp)
 
-if(HAVE_X11)
+if(X11_FOUND)
     set(kcm_fonts_PART_SRCS ${kcm_fonts_PART_SRCS} ${libkxftconfig_SRCS})
 endif()
 
@@ -19,8 +19,8 @@ add_library(kcm_fonts MODULE ${kcm_fonts_PART_SRCS})
 
 target_link_libraries(kcm_fonts Qt5::DBus Qt5::Xml KF5::KCMUtils KF5::I18n \
KF5::KDE4Support ${FREETYPE_LIBRARIES})  
-if(HAVE_X11)
-    set_target_properties(kcm_fonts PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+if(X11_FOUND)
+    set_target_properties(kcm_fonts PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
     target_link_libraries(kcm_fonts Qt5::X11Extras)
     if(FONTCONFIG_FOUND)
         target_link_libraries(kcm_fonts ${FONTCONFIG_LIBRARIES})
diff --git a/plasma-desktop/kcms/input/CMakeLists.txt \
b/plasma-desktop/kcms/input/CMakeLists.txt index dfd2aa0..015afbf 100644
--- a/plasma-desktop/kcms/input/CMakeLists.txt
+++ b/plasma-desktop/kcms/input/CMakeLists.txt
@@ -53,7 +53,7 @@ kde4_add_ui_files(kcm_input_PART_SRCS kmousedlg.ui \
logitechmouse_base.ui )  qt5_add_dbus_interface(kcm_input_PART_SRCS ${klauncher_xml} \
klauncher_iface)  
 add_library(kcm_input MODULE ${kcm_input_PART_SRCS})
-set_target_properties(kcm_input PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+set_target_properties(kcm_input PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
 
 
 target_link_libraries(kcm_input
@@ -82,7 +82,7 @@ install(TARGETS kcm_input  DESTINATION ${PLUGIN_INSTALL_DIR} )
 set(kcm_cursortheme_PART_SRCS kcmcursortheme.cpp ${libnoinst_SRCS})
 
 add_library(kcm_cursortheme MODULE ${kcm_cursortheme_PART_SRCS})
-set_target_properties(kcm_cursortheme PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+set_target_properties(kcm_cursortheme PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
 
 
 target_link_libraries(kcm_cursortheme
diff --git a/plasma-desktop/kcms/style/CMakeLists.txt \
b/plasma-desktop/kcms/style/CMakeLists.txt index 300933b..7e1b558 100644
--- a/plasma-desktop/kcms/style/CMakeLists.txt
+++ b/plasma-desktop/kcms/style/CMakeLists.txt
@@ -15,7 +15,7 @@ qt5_add_dbus_interface(kcm_style_PART_SRCS ${klauncher_xml} \
klauncher_iface)  kde4_add_ui_files(kcm_style_PART_SRCS stylepreview.ui \
finetuning.ui)  
 add_library(kcm_style MODULE ${kcm_style_PART_SRCS})
-set_target_properties(kcm_style PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+set_target_properties(kcm_style PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
 
 target_link_libraries(kcm_style
     Qt5::X11Extras
diff --git a/plasma-workspace/klipper/CMakeLists.txt \
b/plasma-workspace/klipper/CMakeLists.txt index 9677fdd..11e337c 100644
--- a/plasma-workspace/klipper/CMakeLists.txt
+++ b/plasma-workspace/klipper/CMakeLists.txt
@@ -35,7 +35,7 @@ set(klipper_KDEINIT_SRCS ${libklipper_common_SRCS} main.cpp \
tray.cpp)  
 kf5_add_kdeinit_executable(klipper ${klipper_KDEINIT_SRCS})
 
-set_target_properties(kdeinit_klipper PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+set_target_properties(kdeinit_klipper PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
 target_link_libraries(kdeinit_klipper Qt5::X11Extras KF5::GlobalAccel \
KF5::WindowSystem KF5::KDE4Support ${X11_LIBRARIES} ${ZLIB_LIBRARY})  if \
(X11_Xfixes_FOUND)  target_link_libraries(kdeinit_klipper ${X11_Xfixes_LIB})
diff --git a/plasma-workspace/krunner/CMakeLists.txt \
b/plasma-workspace/krunner/CMakeLists.txt index 02e6c80..aa3c0c8 100644
--- a/plasma-workspace/krunner/CMakeLists.txt
+++ b/plasma-workspace/krunner/CMakeLists.txt
@@ -11,13 +11,12 @@ set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol \
C-language Binding  )
 
 if(X11_FOUND AND XCB_XCB_FOUND)
-  set(HAVE_X11 1)
   find_package(Qt5 REQUIRED NO_MODULE COMPONENTS X11Extras)
   #X11_Xrender discovery is done by FindX11
   #add_feature_info("X Rendering Extension (libXrender)" X11_Xrender_FOUND "Support \
for compositing, rendering operations, and alpha-blending. STRONGLY RECOMMENDED")  \
endif()  
-if(HAVE_X11 AND XCB_XCB_FOUND AND XCB_COMPOSITE_FOUND AND XCB_DAMAGE_FOUND)
+if(X11_FOUND AND XCB_XCB_FOUND AND XCB_COMPOSITE_FOUND AND XCB_DAMAGE_FOUND)
     add_definitions(-DHAVE_XCB_COMPOSITE=1)
     include_directories(
         ${XCB_XCB_INCLUDE_DIR}
@@ -27,7 +26,7 @@ if(HAVE_X11 AND XCB_XCB_FOUND AND XCB_COMPOSITE_FOUND AND \
XCB_DAMAGE_FOUND)  else()
     add_definitions(-DHAVE_XCB_COMPOSITE=0)
 endif()
-if(HAVE_X11 AND XCB_XCB_FOUND AND XCB_SHAPE_FOUND)
+if(X11_FOUND AND XCB_XCB_FOUND AND XCB_SHAPE_FOUND)
     add_definitions(-DHAVE_XCB_SHAPE=1)
     include_directories(${XCB_SHAPE_INCLUDE_DIR})
 else()
@@ -75,7 +74,7 @@ target_link_libraries(krunner
     KF5::DBusAddons
 )
 
-if(HAVE_X11)
+if(X11_FOUND)
   target_link_libraries(krunner ${X11_LIBRARIES} ${XCB_XCB_LIBRARY} )
   target_link_libraries(krunner Qt5::X11Extras)
 
diff --git a/plasma-workspace/libkworkspace/CMakeLists.txt \
b/plasma-workspace/libkworkspace/CMakeLists.txt index bfedf0b..9003ae0 100644
--- a/plasma-workspace/libkworkspace/CMakeLists.txt
+++ b/plasma-workspace/libkworkspace/CMakeLists.txt
@@ -32,8 +32,8 @@ target_link_libraries(kworkspace Qt5::DBus Qt5::Core
 target_include_directories(kworkspace PUBLIC \
                "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
                                       INTERFACE \
"$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/kworkspace>" )  
-if(HAVE_X11)
-    set_target_properties(kworkspace PROPERTIES COMPILE_FLAGS -DHAVE_X11)
+if(X11_FOUND)
+    set_target_properties(kworkspace PROPERTIES COMPILE_FLAGS -DHAVE_X11=1)
     target_link_libraries(kworkspace Qt5::X11Extras ${X11_LIBRARIES})
 endif()
 
diff --git a/plasma-workspace/libtaskmanager/CMakeLists.txt \
b/plasma-workspace/libtaskmanager/CMakeLists.txt index 316449b..de2d2ff 100644
--- a/plasma-workspace/libtaskmanager/CMakeLists.txt
+++ b/plasma-workspace/libtaskmanager/CMakeLists.txt
@@ -48,7 +48,7 @@ target_link_libraries(taskmanager
     KF5::Service
     KF5::WindowSystem
 )
-if (HAVE_X11)
+if (X11_FOUND)
     target_link_libraries(taskmanager ${Qt5X11Extras_LIBRARIES} ${X11_LIBRARIES})
     if (X11_Xfixes_FOUND)
     target_link_libraries(taskmanager ${X11_Xfixes_LIB})


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic