2001-11-11 07:01:06 +03:00
|
|
|
#
|
2002-09-02 23:46:04 +04:00
|
|
|
# try to find X11 on UNIX systems.
|
2001-11-11 07:01:06 +03:00
|
|
|
#
|
2002-09-02 23:46:04 +04:00
|
|
|
# The following values are defined
|
2002-10-29 21:30:13 +03:00
|
|
|
# CMAKE_X11_INCLUDE_PATH - where to find X11.h
|
|
|
|
# CMAKE_X_LIBS - link against these to use X11
|
|
|
|
# CMAKE_HAS_X - True if X11 is available
|
|
|
|
# CMAKE_X11_LIBDIR - Directory with X11 library
|
|
|
|
# CMAKE_Xext_LIBDIR - Directory with Xext library
|
2002-09-03 14:10:06 +04:00
|
|
|
|
2002-09-02 23:46:04 +04:00
|
|
|
IF (UNIX)
|
2002-10-29 21:30:13 +03:00
|
|
|
SET(CMAKE_X_PRE_LIBS "")
|
|
|
|
SET(CMAKE_X_REAL_LIBS "")
|
|
|
|
SET(CMAKE_X_EXTRA_LIBS "")
|
|
|
|
SET(CMAKE_HAS_X 0)
|
2002-09-02 23:46:04 +04:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
FIND_PATH(CMAKE_X11_INCLUDE_PATH X11/X.h
|
2002-09-02 23:46:04 +04:00
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
/usr/openwin/include
|
|
|
|
/usr/openwin/share/include
|
|
|
|
/usr/X11R6/include
|
|
|
|
/usr/include/X11
|
|
|
|
/opt/graphics/OpenGL/include
|
2001-11-11 07:01:06 +03:00
|
|
|
)
|
2002-09-02 23:46:04 +04:00
|
|
|
|
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
FIND_LIBRARY(CMAKE_X11_LIBDIR X11
|
2002-09-02 23:46:04 +04:00
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/openwin/lib
|
|
|
|
/usr/X11R6/lib
|
2002-06-15 00:49:00 +04:00
|
|
|
)
|
2001-11-11 07:01:06 +03:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
FIND_LIBRARY(CMAKE_Xext_LIBDIR Xext
|
2002-09-02 23:46:04 +04:00
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/openwin/lib
|
|
|
|
/usr/X11R6/lib
|
2001-11-11 07:01:06 +03:00
|
|
|
)
|
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
IF(CMAKE_X11_INCLUDE_PATH)
|
2002-09-02 23:46:04 +04:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
IF(CMAKE_X11_LIBDIR)
|
2002-10-29 23:47:07 +03:00
|
|
|
SET( CMAKE_X_LIBS "${CMAKE_X_LIBS};${CMAKE_X11_LIBDIR}" )
|
2002-10-29 21:30:13 +03:00
|
|
|
ENDIF(CMAKE_X11_LIBDIR)
|
2002-06-15 00:49:00 +04:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
IF(CMAKE_Xext_LIBDIR)
|
2002-10-29 23:47:07 +03:00
|
|
|
SET( CMAKE_X_LIBS "${CMAKE_X_LIBS};${CMAKE_Xext_LIBDIR}" )
|
2002-10-29 21:30:13 +03:00
|
|
|
ENDIF(CMAKE_Xext_LIBDIR)
|
2002-09-05 20:00:45 +04:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
ENDIF(CMAKE_X11_INCLUDE_PATH)
|
2002-09-05 20:00:45 +04:00
|
|
|
|
2002-10-29 21:30:13 +03:00
|
|
|
# Deprecated variable fro backwards compatibility with CMake 1.4
|
|
|
|
IF(CMAKE_X11_INCLUDE_PATH)
|
|
|
|
IF(CMAKE_X_LIBS)
|
|
|
|
SET(CMAKE_HAS_X 1)
|
|
|
|
ENDIF(CMAKE_X_LIBS)
|
|
|
|
ENDIF(CMAKE_X11_INCLUDE_PATH)
|
2002-10-29 23:47:07 +03:00
|
|
|
IF(CMAKE_HAS_X)
|
|
|
|
SET (CMAKE_X_LIBS "${CMAKE_X_PRE_LIBS};${CMAKE_X_LIBS};${CMAKE_X_EXTRA_LIBS}"
|
|
|
|
CACHE STRING
|
|
|
|
"Libraries and options used in X11 programs.")
|
|
|
|
|
|
|
|
SET (CMAKE_X_CFLAGS "${CMAKE_X_CFLAGS}" CACHE STRING
|
|
|
|
"X11 extra flags.")
|
|
|
|
ENDIF(CMAKE_HAS_X)
|
2002-10-29 21:30:13 +03:00
|
|
|
SET (CMAKE_HAS_X ${CMAKE_HAS_X} CACHE INTERNAL "Is X11 around.")
|
2002-09-02 23:46:04 +04:00
|
|
|
ENDIF (UNIX)
|