cmake: Handle libssh threas library correctly

This should fix the build on Windows and would not install pkg files.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2015-09-07 07:46:11 +02:00
parent 2f193b5cbb
commit 5b586fdfec
5 changed files with 32 additions and 10 deletions

View File

@@ -22,12 +22,12 @@ set(TORTURE_LINK_LIBRARIES
${LIBSSH_STATIC_LIBRARY}
${LIBSSH_LINK_LIBRARIES})
if (Threads_FOUND)
if (LIBSSH_THREADS)
set(TORTURE_LINK_LIBRARIES
${TORTURE_LINK_LIBRARIES}
${LIBSSH_THREADS_STATIC_LIBRARY}
${LIBSSH_THREADS_LINK_LIBRARIES})
endif ()
endif (LIBSSH_THREADS)
# create test library
add_library(${TORTURE_LIBRARY} STATIC cmdline.c torture.c)

View File

@@ -14,11 +14,13 @@ if (UNIX AND NOT WIN32)
# requires ssh-keygen
add_cmocka_test(torture_keyfiles torture_keyfiles.c ${TORTURE_LIBRARY})
add_cmocka_test(torture_pki torture_pki.c ${TORTURE_LIBRARY})
# requires pthread
add_cmocka_test(torture_rand torture_rand.c ${TORTURE_LIBRARY})
# requires /dev/null
add_cmocka_test(torture_channel torture_channel.c ${TORTURE_LIBRARY})
if (WITH_SERVER AND Threads_FOUND)
add_cmocka_test(torture_server_x11 torture_server_x11.c ${TORTURE_LIBRARY})
endif (WITH_SERVER AND Threads_FOUND)
# requires pthread
if (LIBSSH_THREADS)
add_cmocka_test(torture_rand torture_rand.c ${TORTURE_LIBRARY})
if (WITH_SERVER)
add_cmocka_test(torture_server_x11 torture_server_x11.c ${TORTURE_LIBRARY})
endif (WITH_SERVER)
endif (LIBSSH_THREADS)
endif (UNIX AND NOT WIN32)