Backwards compatibility. Andy and Bill made me add socket library.

This commit is contained in:
Will Schroeder 2002-11-12 16:27:24 -05:00
parent e020a6d171
commit 4b7b9ab2ec
1 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,7 @@ IF (UNIX)
SET(CMAKE_X_PRE_LIBS "")
SET(CMAKE_X_REAL_LIBS "")
SET(CMAKE_X_EXTRA_LIBS "")
SET(CMAKE_X_EXTRA_LIBS "")
SET(CMAKE_HAS_X 0)
FIND_PATH(CMAKE_X11_INCLUDE_PATH X11/X.h
@ -87,6 +88,11 @@ IF (UNIX)
ENDIF(CMAKE_X_LIBS)
ENDIF(CMAKE_X11_INCLUDE_PATH)
IF(CMAKE_HAS_X)
INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_HAVE_SOCKET_LIBRARY)
IF (CMAKE_HAVE_SOCKET_LIBRARY)
SET (CMAKE_X_EXTRA_LIBS "${CMAKE_X_EXTRA_LIBS};-lsocket")
ENDIF (CMAKE_HAVE_SOCKET_LIBRARY)
SET (CMAKE_X_LIBS "${CMAKE_X_PRE_LIBS};${CMAKE_X_LIBS};${CMAKE_X_EXTRA_LIBS}"
CACHE STRING
"Libraries and options used in X11 programs.")
@ -102,4 +108,5 @@ IF (UNIX)
CMAKE_Xlib_INCLUDE_PATH
CMAKE_Xutil_INCLUDE_PATH
)
ENDIF (UNIX)