summaryrefslogtreecommitdiffstats
path: root/FindXscreensaver.cmake
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-20 03:59:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-20 03:59:04 +0000
commit5379c37cfc91f24716af951dd08503f65f7575d7 (patch)
tree59288babdc8ae3bf4b529b7ced17509450f05679 /FindXscreensaver.cmake
parent99a9c9fb9a9ce322e8b43fc101877c6a78622bca (diff)
downloadtdeartwork-5379c37cfc91f24716af951dd08503f65f7575d7.tar.gz
tdeartwork-5379c37cfc91f24716af951dd08503f65f7575d7.zip
Commit initial kdeartwork CMake support, courtesy of Golubev Alexander
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1259766 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'FindXscreensaver.cmake')
-rw-r--r--FindXscreensaver.cmake82
1 files changed, 82 insertions, 0 deletions
diff --git a/FindXscreensaver.cmake b/FindXscreensaver.cmake
new file mode 100644
index 00000000..57236097
--- /dev/null
+++ b/FindXscreensaver.cmake
@@ -0,0 +1,82 @@
+#Macro to find xscreensaver directory
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# got from kde4
+
+if (NOT XSCREENSAVER_FOUND)
+ set(xscreensaver_alldirs)
+ set(xscreensaver_checkdirs ${TDE_INCLUDE_DIR}
+ /usr/
+ /usr/local/
+ /opt/local/
+ /usr/X11R6/
+ /opt/kde/
+ /opt/kde3/
+ /usr/kde/
+ /usr/local/kde/
+ /usr/local/xscreensaver/
+ /usr/openwin/lib/xscreensaver/
+ /etc/ )
+ foreach(suffix lib${LIB_SUFFIX}/xscreensaver lib${LIB_SUFFIX}/misc/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver
+bin/xscreensaver-hacks hacks)
+ foreach(xscreensaver_path ${xscreensaver_checkdirs} )
+ set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix})
+ endforeach(xscreensaver_path ${xscreensaver_checkdirs} )
+ endforeach(suffix lib${LIB_SUFFIX}/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver bin/xscreensaver-hacks hacks)
+ FIND_PATH(XSCREENSAVER_DIR deco ${xscreensaver_alldirs})
+
+ set(XSCREENSAVER_CONFIG_DIR)
+ FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml
+ ${TDE_INCLUDE_DIR}
+ /usr/
+ /usr/local/
+ /opt/local/
+ /usr/X11R6/
+ /opt/kde/
+ /opt/kde3/
+ /usr/kde/
+ /usr/share/xscreensaver/
+ /usr/local/kde/
+ /usr/local/xscreensaver/
+ /usr/openwin/lib/xscreensaver/
+ /etc/
+ )
+ #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
+
+ if(XSCREENSAVER_CONFIG_DECO)
+ set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_DECO}/config/")
+ #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
+ endif(XSCREENSAVER_CONFIG_DECO)
+
+
+ # Try and locate XScreenSaver config when path doesn't include config
+ if(NOT XSCREENSAVER_CONFIG_DIR)
+ FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml
+ /etc/xscreensaver
+ )
+ endif(NOT XSCREENSAVER_CONFIG_DIR)
+endif(NOT XSCREENSAVER_FOUND)
+
+#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
+#MESSAGE(STATUS "XSCREENSAVER_DIR :<${XSCREENSAVER_DIR}>")
+
+# Need to fix hack
+if(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
+ set(XSCREENSAVER_FOUND TRUE)
+endif(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
+
+if (XSCREENSAVER_FOUND)
+ if (NOT Xscreensaver_FIND_QUIETLY)
+ message(STATUS "Found SCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
+ endif (NOT Xscreensaver_FIND_QUIETLY)
+else (XSCREENSAVER_FOUND)
+ if (Xscreensaver_FIND_REQUIRED)
+ message(FATAL_ERROR "XScreenSaver not found")
+ endif (Xscreensaver_FIND_REQUIRED)
+endif (XSCREENSAVER_FOUND)
+
+
+MARK_AS_ADVANCED(XSCREENSAVER_DIR XSCREENSAVER_CONFIG_DIR)