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 --- src/CMakeLists.txt | 1 + src/threads/CMakeLists.txt | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4865d765..1012ddf0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -300,6 +300,7 @@ if (WITH_STATIC_LIB) ) endif (WITH_STATIC_LIB) +message(STATUS "Threads_FOUND=${Threads_FOUND}") if (Threads_FOUND) add_subdirectory(threads) endif (Threads_FOUND) diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt index a32d601e..2ab4e1ba 100644 --- a/src/threads/CMakeLists.txt +++ b/src/threads/CMakeLists.txt @@ -27,8 +27,9 @@ set(LIBSSH_THREADS_LINK_LIBRARIES ${LIBSSH_SHARED_LIBRARY} ) -set(libssh_threads_SRCS -) +message(STATUS "threads library: Threads_FOUND=${Threads_FOUND}") + +set(libssh_threads_SRCS) # empty SRC # build and link pthread if (CMAKE_USE_PTHREADS_INIT) @@ -41,6 +42,8 @@ if (CMAKE_USE_PTHREADS_INIT) ${LIBSSH_THREADS_LINK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ) + + message(STATUS "libssh_threads_SRCS=${libssh_threads_SRCS}") endif (CMAKE_USE_PTHREADS_INIT) set(LIBSSH_THREADS_LINK_LIBRARIES @@ -54,6 +57,8 @@ include_directories( ) if (libssh_threads_SRCS) + set(LIBSSH_THREADS ON CACHE "libssh threads lib" INTERNAL) + add_library(${LIBSSH_THREADS_SHARED_LIBRARY} SHARED ${libssh_threads_SRCS}) target_link_libraries(${LIBSSH_THREADS_SHARED_LIBRARY} ${LIBSSH_THREADS_LINK_LIBRARIES}) -- cgit