summaryrefslogtreecommitdiffstats
path: root/redhat/kdebase/kdebase-3.5.13-add_xscreensaver_support.patch
blob: 8e52ab9718a2d01a4241c128c1c9e7d658e159f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
commit 80deb52955cbd917e10f015f37699d830cb681ce
Author: Slávek Banko <slavek.banko@axis.cz>
Date:   1339336699 +0200

    Add xscreensaver support to CMake
    This closes Bug 859

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31fb46c..3da5b2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,6 +67,7 @@
 option( WITH_XDAMAGE "Enable xdamage support" OFF )
 option( WITH_XEXT "Enable xext support" OFF )
 option( WITH_XTEST "Enable xext support" OFF )
+option( WITH_XSCREENSAVER "Enable xscreensaver support" ${WITH_ALL_OPTIONS} )
 option( WITH_LIBUSB "Enable control of some mouse models through libusb" OFF )
 option( WITH_LIBRAW1394 "Enable visualization of ieee1394 devices through libraw1394" OFF )
 option( WITH_SUDO_KDESU_BACKEND "Use sudo as backend for kdesu (default is su)" OFF )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index ded1d00..1d9c83d 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -144,6 +144,26 @@ if( WITH_XTEST )
 endif( )
 
 
+# xscreensaver ()
+if( WITH_XSCREENSAVER )
+  check_library_exists( Xss XScreenSaverQueryInfo "" HAVE_XSSLIB )
+  if( HAVE_XSSLIB )
+    pkg_search_module( XSS xscrnsaver )
+  else( )
+    check_library_exists( Xext XScreenSaverQueryInfo "" HAVE_XSSLIB )
+    if( HAVE_XSSLIB )
+      pkg_search_module( XSS xext )
+    endif( )
+  endif( )
+  check_include_file( X11/extensions/scrnsaver.h HAVE_XSCREENSAVER_H )
+  if( HAVE_XSSLIB AND HAVE_XSCREENSAVER_H )
+    set( HAVE_XSCREENSAVER 1 )
+  else( )
+    tde_message_fatal( "xscreensaver is requested, but was not found on your system" )
+  endif( )
+endif( )
+
+
 # GL
 if( BUILD_KDESKTOP OR BUILD_KCONTROL OR BUILD_KSCREENSAVER )
 check_library_exists( GL glXChooseVisual "" HAVE_GLXCHOOSEVISUAL )
diff --git a/config.h.cmake b/config.h.cmake
index 39d6d85..772ca88 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -21,6 +21,9 @@
 // kxkb
 #cmakedefine HAVE_XTEST 1
 
+// xscreensaver
+#cmakedefine HAVE_XSCREENSAVER 1
+
 // kdm, kioslave
 #cmakedefine HAVE_TERMIOS_H 1
 
diff --git a/kdesktop/CMakeLists.txt b/kdesktop/CMakeLists.txt
index 99d86d1..b2e4628 100644
--- a/kdesktop/CMakeLists.txt
+++ b/kdesktop/CMakeLists.txt
@@ -94,6 +94,7 @@ tde_add_tdeinit_executable( ${target} AUTOMOC
     kdesktopsettings-static bgnd-static dmctl-static
     konq-shared kutils-shared
     ${XRENDER_LIBRARIES} ${XCURSOR_LIBRARIES} Xext dl
+    ${XSS_LIBRARIES}
 )