summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Van Meir <wouter.vanmeir@pandora.be>2010-05-07 11:23:03 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2010-05-07 15:01:18 +0200
commit4fa9e2bbab3c677752fe0edc67f4e5a228d79d48 (patch)
treef7cca52105bed1ffa1f4e0d7c177ecf7993bc5d5
parent21fd3a45b9095ac7dc19cf0dc2cdea4eeafa1776 (diff)
downloadlibvncserver-4fa9e2bbab3c677752fe0edc67f4e5a228d79d48.zip
libvncserver-4fa9e2bbab3c677752fe0edc67f4e5a228d79d48.tar.gz
fix CMakeLists.txt: other way to find pthread library
... and fixed linking of the tests in the examples directory. Signed-off-by: Wouter Van Meir <wouter.vanmeir@pandora.be> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--CMakeLists.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30dab04..4e0337b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ find_package(ZLIB)
find_package(JPEG)
find_package(SDL)
find_package(GnuTLS)
+find_package(Threads)
if(SDL_FOUND) # == pthread.h available
option(TIGHTVNC_FILETRANSFER "Enable filetransfer" ON)
@@ -34,7 +35,6 @@ endif(GNUTLS_FOUND)
check_include_file("fcntl.h" LIBVNCSERVER_HAVE_FCNTL_H)
check_include_file("netinet/in.h" LIBVNCSERVER_HAVE_NETINET_IN_H)
-check_include_file("pthread.h" LIBVNCSERVER_HAVE_LIBPTHREAD)
check_include_file("sys/socket.h" LIBVNCSERVER_HAVE_SYS_SOCKET_H)
check_include_file("sys/stat.h" LIBVNCSERVER_HAVE_SYS_STAT_H)
check_include_file("sys/time.h" LIBVNCSERVER_HAVE_SYS_TIME_H)
@@ -50,6 +50,9 @@ check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
check_function_exists(gettimeofday LIBVNCSERVER_HAVE_GETTIMEOFDAY)
+if(CMAKE_USE_PTHREADS_INIT)
+ set(LIBVNCSERVER_HAVE_LIBPTHREAD 1)
+endif(CMAKE_USE_PTHREADS_INIT)
if(LIBVNCSERVER_HAVE_SYS_SOCKET_H)
# socklen_t
list(APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
@@ -228,13 +231,13 @@ endif(HAVE_FFMPEG)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/examples)
foreach(test ${LIBVNCSERVER_TESTS})
add_executable(examples/${test} ${LIBVNCSRVTEST_DIR}/${test}.c)
- target_link_libraries(examples/${test} vncserver)
+ target_link_libraries(examples/${test} vncserver ${CMAKE_THREAD_LIBS_INIT})
endforeach(test ${LIBVNCSERVER_TESTS})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/client_examples)
foreach(test ${LIBVNCCLIENT_TESTS})
add_executable(client_examples/${test} ${LIBVNCCLITEST_DIR}/${test}.c)
- target_link_libraries(client_examples/${test} vncclient ${GNUTLS_LIBRARIES} ${SDL_LIBRARY} ${FFMPEG_LIBRARIES})
+ target_link_libraries(client_examples/${test} vncclient ${CMAKE_THREAD_LIBS_INIT} ${GNUTLS_LIBRARIES} ${SDL_LIBRARY} ${FFMPEG_LIBRARIES})
endforeach(test ${LIBVNCCLIENT_TESTS})
install_targets(/lib vncserver)
OpenPOWER on IntegriCloud