2010-01-21 23:54:20 +03:00
|
|
|
project(libssh-examples C CXX)
|
2009-07-25 19:03:01 +04:00
|
|
|
|
|
|
|
set(examples_SRCS
|
|
|
|
authentication.c
|
|
|
|
knownhosts.c
|
2009-09-06 13:54:57 +04:00
|
|
|
connect_ssh.c
|
2009-07-25 19:03:01 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${LIBSSH_PUBLIC_INCLUDE_DIRS}
|
2011-01-23 20:57:35 +03:00
|
|
|
${CMAKE_BINARY_DIR}
|
2009-07-25 19:03:01 +04:00
|
|
|
)
|
|
|
|
|
2016-05-03 13:12:23 +03:00
|
|
|
if (ARGP_INCLUDE_DIR)
|
|
|
|
include_directories(${ARGP_INCLUDE_DIR})
|
|
|
|
endif()
|
|
|
|
|
2013-07-22 12:50:35 +04:00
|
|
|
if (UNIX AND NOT WIN32)
|
2011-01-23 20:57:35 +03:00
|
|
|
add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
|
|
|
|
target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})
|
2010-05-17 22:03:44 +04:00
|
|
|
|
2011-01-23 20:57:35 +03:00
|
|
|
add_executable(scp_download scp_download.c ${examples_SRCS})
|
|
|
|
target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY})
|
2009-07-25 19:03:01 +04:00
|
|
|
|
2011-01-23 20:57:35 +03:00
|
|
|
add_executable(sshnetcat sshnetcat.c ${examples_SRCS})
|
|
|
|
target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY})
|
2009-10-09 23:44:05 +04:00
|
|
|
|
2011-01-23 20:57:35 +03:00
|
|
|
if (WITH_SFTP)
|
|
|
|
add_executable(samplesftp samplesftp.c ${examples_SRCS})
|
|
|
|
target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
endif (WITH_SFTP)
|
2009-10-09 23:44:05 +04:00
|
|
|
|
2013-03-04 03:36:16 +04:00
|
|
|
add_executable(samplessh sample.c ${examples_SRCS})
|
|
|
|
target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
|
2016-05-03 13:12:23 +03:00
|
|
|
if (WITH_SERVER AND ARGP_LIBRARY)
|
2014-02-16 20:59:46 +04:00
|
|
|
if (HAVE_LIBUTIL)
|
|
|
|
add_executable(ssh_server_fork ssh_server_fork.c)
|
2016-03-17 12:42:52 +03:00
|
|
|
target_link_libraries(ssh_server_fork ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY} util)
|
2014-02-16 20:59:46 +04:00
|
|
|
endif (HAVE_LIBUTIL)
|
|
|
|
|
2013-07-24 22:02:49 +04:00
|
|
|
if (WITH_GSSAPI AND GSSAPI_FOUND)
|
2013-07-22 12:50:35 +04:00
|
|
|
add_executable(samplesshd-cb samplesshd-cb.c)
|
2016-03-17 12:42:52 +03:00
|
|
|
target_link_libraries(samplesshd-cb ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
|
2011-02-20 15:07:34 +03:00
|
|
|
|
2013-07-22 12:50:35 +04:00
|
|
|
add_executable(proxy proxy.c)
|
2016-03-17 12:42:52 +03:00
|
|
|
target_link_libraries(proxy ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
|
2013-07-24 22:02:49 +04:00
|
|
|
endif (WITH_GSSAPI AND GSSAPI_FOUND)
|
2013-03-05 13:10:55 +04:00
|
|
|
|
2013-07-22 12:50:35 +04:00
|
|
|
add_executable(samplesshd-kbdint samplesshd-kbdint.c)
|
2016-03-17 12:42:52 +03:00
|
|
|
target_link_libraries(samplesshd-kbdint ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY})
|
2013-02-12 00:44:25 +04:00
|
|
|
|
2016-05-04 15:25:29 +03:00
|
|
|
endif (WITH_SERVER AND ARGP_LIBRARY)
|
2013-07-22 12:50:35 +04:00
|
|
|
endif (UNIX AND NOT WIN32)
|
2009-10-09 23:44:05 +04:00
|
|
|
|
2011-01-23 23:49:13 +03:00
|
|
|
add_executable(exec exec.c ${examples_SRCS})
|
|
|
|
target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
|
|
|
|
add_executable(senddata senddata.c ${examples_SRCS})
|
|
|
|
target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
|
2011-01-23 20:57:35 +03:00
|
|
|
add_executable(libsshpp libsshpp.cpp)
|
|
|
|
target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
|
|
|
|
add_executable(libsshpp_noexcept libsshpp_noexcept.cpp)
|
|
|
|
target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY})
|