mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry-picked from commit 6596d27e)
69 lines
1.6 KiB
CMake
69 lines
1.6 KiB
CMake
project(libssh-tests C)
|
|
|
|
if (BSD OR SOLARIS OR OSX)
|
|
find_package(Argp)
|
|
endif (BSD OR SOLARIS OR OSX)
|
|
|
|
set(TORTURE_LIBRARY torture)
|
|
|
|
include_directories(
|
|
${LIBSSH_PUBLIC_INCLUDE_DIRS}
|
|
${CMOCKA_INCLUDE_DIR}
|
|
${OPENSSL_INCLUDE_DIR}
|
|
${GCRYPT_INCLUDE_DIR}
|
|
${ZLIB_INCLUDE_DIR}
|
|
${CMAKE_BINARY_DIR}
|
|
${CMAKE_SOURCE_DIR}/src
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
)
|
|
|
|
set(TORTURE_LINK_LIBRARIES
|
|
${CMOCKA_LIBRARY}
|
|
${LIBSSH_STATIC_LIBRARY}
|
|
${LIBSSH_LINK_LIBRARIES})
|
|
|
|
if (LIBSSH_THREADS)
|
|
set(TORTURE_LINK_LIBRARIES
|
|
${TORTURE_LINK_LIBRARIES}
|
|
${LIBSSH_THREADS_STATIC_LIBRARY}
|
|
${LIBSSH_THREADS_LINK_LIBRARIES})
|
|
endif (LIBSSH_THREADS)
|
|
|
|
# create test library
|
|
add_library(${TORTURE_LIBRARY} STATIC cmdline.c torture.c)
|
|
target_link_libraries(${TORTURE_LIBRARY}
|
|
${TORTURE_LINK_LIBRARIES}
|
|
${ARGP_LIBRARIES}
|
|
)
|
|
|
|
set(TEST_TARGET_LIBRARIES
|
|
${TORTURE_LIBRARY}
|
|
${TORTURE_LINK_LIBRARIES}
|
|
)
|
|
|
|
add_subdirectory(unittests)
|
|
|
|
if (WITH_CLIENT_TESTING)
|
|
find_package(socket_wrapper 1.1.5 REQUIRED)
|
|
find_package(nss_wrapper 1.1.2 REQUIRED)
|
|
find_program(SSHD_EXECUTABLE
|
|
NAME
|
|
sshd
|
|
PATHS
|
|
/sbin
|
|
/usr/sbin
|
|
/usr/local/sbin)
|
|
if (NOT SSHD_EXECUTABLE)
|
|
message(SEND_ERROR "Could not find sshd which is required for client testing")
|
|
endif()
|
|
add_subdirectory(client)
|
|
endif (WITH_CLIENT_TESTING)
|
|
|
|
if (WITH_BENCHMARKS)
|
|
add_subdirectory(benchmarks)
|
|
endif (WITH_BENCHMARKS)
|
|
|
|
if (WITH_SERVER)
|
|
add_subdirectory(pkd)
|
|
endif (WITH_SERVER)
|