tdebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindXscreensaver.cmake 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #Macro to find xscreensaver directory
  2. # Copyright (c) 2006, Laurent Montel, <montel@kde.org>
  3. #
  4. # Redistribution and use is allowed according to the terms of the BSD license.
  5. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  6. # got from kde4
  7. if (NOT XSCREENSAVER_FOUND)
  8. set(xscreensaver_alldirs)
  9. set(xscreensaver_checkdirs ${TDE_INCLUDE_DIR}
  10. /usr/
  11. /usr/local/
  12. /opt/local/
  13. /usr/X11R6/
  14. /opt/kde/
  15. /opt/kde3/
  16. /usr/kde/
  17. /usr/local/kde/
  18. /usr/local/xscreensaver/
  19. /usr/openwin/lib/xscreensaver/
  20. /etc/ )
  21. foreach(suffix lib${LIB_SUFFIX}/xscreensaver lib${LIB_SUFFIX}/misc/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver
  22. bin/xscreensaver-hacks hacks)
  23. foreach(xscreensaver_path ${xscreensaver_checkdirs} )
  24. set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix})
  25. endforeach(xscreensaver_path ${xscreensaver_checkdirs} )
  26. endforeach(suffix lib${LIB_SUFFIX}/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver bin/xscreensaver-hacks hacks)
  27. FIND_PATH(XSCREENSAVER_DIR deco ${xscreensaver_alldirs})
  28. set(XSCREENSAVER_CONFIG_DIR)
  29. FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml
  30. ${TDE_INCLUDE_DIR}
  31. /usr/
  32. /usr/local/
  33. /opt/local/
  34. /usr/X11R6/
  35. /opt/kde/
  36. /opt/kde3/
  37. /usr/kde/
  38. /usr/share/xscreensaver/
  39. /usr/local/kde/
  40. /usr/local/xscreensaver/
  41. /usr/local/share/xscreensaver/
  42. /usr/openwin/lib/xscreensaver/
  43. /etc/
  44. )
  45. #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
  46. if(XSCREENSAVER_CONFIG_DECO)
  47. set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_DECO}/config/")
  48. #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
  49. endif(XSCREENSAVER_CONFIG_DECO)
  50. # Try and locate XScreenSaver config when path doesn't include config
  51. if(NOT XSCREENSAVER_CONFIG_DIR)
  52. FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml
  53. /etc/xscreensaver
  54. )
  55. endif(NOT XSCREENSAVER_CONFIG_DIR)
  56. endif(NOT XSCREENSAVER_FOUND)
  57. #MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
  58. #MESSAGE(STATUS "XSCREENSAVER_DIR :<${XSCREENSAVER_DIR}>")
  59. # Need to fix hack
  60. if(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
  61. set(XSCREENSAVER_FOUND TRUE)
  62. endif(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
  63. if (XSCREENSAVER_FOUND)
  64. if (NOT Xscreensaver_FIND_QUIETLY)
  65. message(STATUS "Found SCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
  66. endif (NOT Xscreensaver_FIND_QUIETLY)
  67. else (XSCREENSAVER_FOUND)
  68. if (Xscreensaver_FIND_REQUIRED)
  69. message(FATAL_ERROR "XScreenSaver not found")
  70. endif (Xscreensaver_FIND_REQUIRED)
  71. endif (XSCREENSAVER_FOUND)
  72. MARK_AS_ADVANCED(XSCREENSAVER_DIR XSCREENSAVER_CONFIG_DIR)