1 # cmake macro to test LIBVNCSERVER LIB
3 # Copyright (c) 2006, Alessandro Praduroux <pradu@pradu.it>
4 # Copyright (c) 2007, Urs Wolfer <uwolfer @ kde.org>
6 # Redistribution and use is allowed according to the terms of the BSD license.
7 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
9 INCLUDE(CheckPointerMember)
11 IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
12 # Already in cache, be silent
13 SET(LIBVNCSERVER_FIND_QUIETLY TRUE)
14 ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
16 FIND_PATH(LIBVNCSERVER_INCLUDE_DIR rfb/rfb.h)
18 FIND_LIBRARY(LIBVNCSERVER_LIBRARIES NAMES vncserver libvncserver)
20 # libvncserver and libvncclient are in the same package, so it does
21 # not make sense to add a new cmake script for finding libvncclient.
22 # instead just find the libvncclient also in this file.
23 FIND_PATH(LIBVNCCLIENT_INCLUDE_DIR rfb/rfbclient.h)
24 FIND_LIBRARY(LIBVNCCLIENT_LIBRARIES NAMES vncclient libvncclient)
26 IF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
27 SET(CMAKE_REQUIRED_INCLUDES "${LIBVNCSERVER_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}")
28 CHECK_POINTER_MEMBER(rfbClient* GotXCutText rfb/rfbclient.h LIBVNCSERVER_FOUND)
29 ENDIF (LIBVNCSERVER_INCLUDE_DIR AND LIBVNCSERVER_LIBRARIES)
31 IF (LIBVNCSERVER_FOUND)
32 IF (NOT LIBVNCSERVER_FIND_QUIETLY)
33 MESSAGE(STATUS "Found LibVNCServer: ${LIBVNCSERVER_LIBRARIES}")
34 ENDIF (NOT LIBVNCSERVER_FIND_QUIETLY)
35 ELSE (LIBVNCSERVER_FOUND)
36 IF (LIBVNCSERVER_FIND_REQUIRED)
37 MESSAGE(FATAL_ERROR "Could NOT find acceptable version of LibVNCServer (version 0.9 or later required).")
38 ENDIF (LIBVNCSERVER_FIND_REQUIRED)
39 ENDIF (LIBVNCSERVER_FOUND)
41 MARK_AS_ADVANCED(LIBVNCSERVER_INCLUDE_DIR LIBVNCSERVER_LIBRARIES)