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})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(libssh_scp PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 20:57:35 +03:00
|
|
|
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})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(scp_download PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 20:57:35 +03:00
|
|
|
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})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(sshnetcat PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 20:57:35 +03:00
|
|
|
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})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(samplesftp PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 20:57:35 +03:00
|
|
|
target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
endif (WITH_SFTP)
|
2009-10-09 23:44:05 +04:00
|
|
|
|
2017-11-07 17:28:52 +03:00
|
|
|
add_executable(ssh-client ssh_client.c ${examples_SRCS})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(ssh-client PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2017-11-07 17:28:52 +03:00
|
|
|
target_link_libraries(ssh-client ${LIBSSH_SHARED_LIBRARY})
|
2013-03-04 03:36:16 +04:00
|
|
|
|
2017-11-08 18:28:35 +03:00
|
|
|
if (WITH_SERVER AND (ARGP_LIBRARY OR HAVE_ARGP_H))
|
2014-02-16 20:59:46 +04:00
|
|
|
if (HAVE_LIBUTIL)
|
|
|
|
add_executable(ssh_server_fork ssh_server_fork.c)
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(ssh_server_fork PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
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)
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(samplesshd-cb PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
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)
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(proxy PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
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)
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(samplesshd-kbdint PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
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
|
|
|
|
2017-11-08 18:28:35 +03:00
|
|
|
endif()
|
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})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(exec PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 23:49:13 +03:00
|
|
|
target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY})
|
|
|
|
|
|
|
|
add_executable(senddata senddata.c ${examples_SRCS})
|
2018-08-20 16:17:09 +03:00
|
|
|
target_compile_options(senddata PRIVATE ${DEFAULT_C_COMPILE_FLAGS})
|
2011-01-23 23:49:13 +03:00
|
|
|
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})
|