From 5b586fdfecbe12f3f8e69099d809ca96c7cb978e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 7 Sep 2015 07:46:11 +0200 Subject: cmake: Handle libssh threas library correctly This should fix the build on Windows and would not install pkg files. Signed-off-by: Andreas Schneider --- tests/CMakeLists.txt | 4 ++-- tests/unittests/CMakeLists.txt | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3bbb3309..d87c9c2f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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) diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index 1c9b6914..21825978 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -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) -- cgit