aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-01-21 21:54:20 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-01-21 21:54:20 +0100
commit48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa (patch)
treeede88298d8f6df0338617d819d30efd6e0f3b0ec /examples
parent245deb2abe19d0e465271d54d9e404558d618ecd (diff)
downloadlibssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.tar.gz
libssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.tar.xz
libssh-48ba9c9bc1b6845a2c65773e91fd95a82e2f71aa.zip
stub of C++ wrapper for libssh
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt4
-rw-r--r--examples/libsshpp.cpp10
2 files changed, 13 insertions, 1 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 77eb417..94d8949 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(libssh-examples C)
+project(libssh-examples C CXX)
set(examples_SRCS
authentication.c
@@ -15,11 +15,13 @@ add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
add_executable(scp_download scp_download.c ${examples_SRCS})
add_executable(samplessh sample.c ${examples_SRCS})
add_executable(exec exec.c ${examples_SRCS})
+add_executable(libsshpp libsshpp.cpp)
target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})
target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY})
target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY})
target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY})
+target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY})
include_directories(
${LIBSSH_PUBLIC_INCLUDE_DIRS}
diff --git a/examples/libsshpp.cpp b/examples/libsshpp.cpp
new file mode 100644
index 0000000..eb415d8
--- /dev/null
+++ b/examples/libsshpp.cpp
@@ -0,0 +1,10 @@
+
+#include <libssh/libsshpp.hpp>
+
+int main(int argc, const char **argv){
+ ssh::Session session;
+ session.setOption(SSH_OPTIONS_HOST,"localhost");
+ session.connect();
+ session.userauthAutopubkey();
+ return 0;
+}