summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindX11.cmake7
1 files changed, 7 insertions, 0 deletions
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)