endif()
endif()
+# Check for PAM library
+option(ENABLE_PAM "Enable PAM authentication support" ON)
+if(ENABLE_PAM)
+ check_include_files(security/pam_appl.h HAVE_PAM_H)
+ set(CMAKE_REQUIRED_LIBRARIES -lpam)
+ check_function_exists(pam_start HAVE_PAM_START)
+ set(CMAKE_REQUIRED_LIBRARIES)
+ if(HAVE_PAM_H AND HAVE_PAM_START)
+ set(PAM_LIBS pam)
+ else()
+ set(ENABLE_PAM 0)
+ endif()
+endif()
+set(HAVE_PAM ${ENABLE_PAM})
+
# Check for socket functions
if(WIN32)
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h)
set(RFB_LIBRARIES ${JPEG_LIBRARIES} os)
+if(HAVE_PAM)
+ set(RFB_SOURCES ${RFB_SOURCES} UnixPasswordValidator.cxx
+ UnixPasswordValidator.h pam.c pam.h)
+ set(RFB_LIBRARIES ${RFB_LIBRARIES} ${PAM_LIBS})
+endif()
+
if(GNUTLS_FOUND)
set(RFB_SOURCES
${RFB_SOURCES}
#cmakedefine HAVE_FLTK_FULLSCREEN
#cmakedefine HAVE_FLTK_CURSOR
#cmakedefine ENABLE_NLS 1
+#cmakedefine HAVE_PAM
/* MS Visual Studio 2008 and newer doesn't know ssize_t */
#if defined(HAVE_GNUTLS) && defined(WIN32) && !defined(__MINGW32__)