FindX11.cmake 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #
  2. # try to find X11 on UNIX systems.
  3. #
  4. # The following values are defined
  5. # X11_INCLUDE_DIR - where to find X11.h
  6. # X11_LIBRARIES - link against these to use X11
  7. # X11_FOUND - True if X11 is available
  8. # X11_Xext_FOUND - True if the X11 extensions are available.
  9. IF (UNIX)
  10. FIND_PATH(X11_INCLUDE_DIR X11/X.h
  11. /usr/include
  12. /usr/local/include
  13. /usr/openwin/include
  14. /usr/openwin/share/include
  15. /usr/X11R6/include
  16. /usr/include/X11
  17. /opt/graphics/OpenGL/include
  18. )
  19. FIND_LIBRARY(X11_X11_LIBRARY X11
  20. /usr/lib
  21. /usr/local/lib
  22. /usr/openwin/lib
  23. /usr/X11R6/lib
  24. )
  25. FIND_LIBRARY(X11_Xext_LIBRARY Xext
  26. /usr/lib
  27. /usr/local/lib
  28. /usr/openwin/lib
  29. /usr/X11R6/lib
  30. )
  31. IF(X11_INCLUDE_DIR)
  32. IF(X11_X11_LIBRARY)
  33. SET( X11_FOUND "YES" )
  34. SET( X11_LIBRARIES ${X11_X11_LIBRARY} )
  35. ENDIF(X11_X11_LIBRARY)
  36. IF(X11_Xext_LIBRARY)
  37. SET( X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIBRARY} )
  38. SET( X11_Xext_FOUND "YES")
  39. ENDIF(X11_Xext_LIBRARY)
  40. ENDIF(X11_INCLUDE_DIR)
  41. # Deprecated variable fro backwards compatibility with CMake 1.4
  42. SET (X11_LIBRARY ${X11_X11_LIBRARY})
  43. MARK_AS_ADVANCED(
  44. X11_X11_LIBRARY
  45. X11_Xext_LIBRARY
  46. X11_INCLUDE_DIR
  47. )
  48. ENDIF (UNIX)