From 4b7b9ab2ec8b044014f51f74f4a121f347ea2744 Mon Sep 17 00:00:00 2001 From: Will Schroeder Date: Tue, 12 Nov 2002 16:27:24 -0500 Subject: Backwards compatibility. Andy and Bill made me add socket library. --- Modules/FindX11.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index 509e6e9..c979629 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -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) -- cgit v0.12