aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-11-03 13:45:15 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2013-11-03 13:49:27 +0100
commit4f3ee2fc7e24668eee3f72c59d3766a7ba2d49c2 (patch)
treebe6fb3983d5161eef175eba9c7be42b41299506f
parentf565aeebfa108d03e5c782881edd2ced849a4989 (diff)
downloadlibssh-4f3ee2fc7e24668eee3f72c59d3766a7ba2d49c2.tar.gz
libssh-4f3ee2fc7e24668eee3f72c59d3766a7ba2d49c2.tar.xz
libssh-4f3ee2fc7e24668eee3f72c59d3766a7ba2d49c2.zip
Fix examples compilation on OSX (libargp)
-rw-r--r--cmake/Modules/DefinePlatformDefaults.cmake4
-rw-r--r--examples/CMakeLists.txt6
-rw-r--r--examples/samplesshd-tty.c2
3 files changed, 9 insertions, 3 deletions
diff --git a/cmake/Modules/DefinePlatformDefaults.cmake b/cmake/Modules/DefinePlatformDefaults.cmake
index 502d936b..77f8a461 100644
--- a/cmake/Modules/DefinePlatformDefaults.cmake
+++ b/cmake/Modules/DefinePlatformDefaults.cmake
@@ -26,3 +26,7 @@ endif (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
if (CMAKE_SYSTEM_NAME MATCHES "OS2")
set(OS2 TRUE)
endif (CMAKE_SYSTEM_NAME MATCHES "OS2")
+
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ set (OSX TRUE)
+endif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index fc1c9341..c155e097 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -11,9 +11,9 @@ include_directories(
${CMAKE_BINARY_DIR}
)
-if (BSD OR SOLARIS)
+if (BSD OR SOLARIS OR OSX)
find_package(Argp)
-endif (BSD OR SOLARIS)
+endif (BSD OR SOLARIS OR OSX)
if (UNIX AND NOT WIN32)
add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
@@ -28,7 +28,7 @@ if (UNIX AND NOT WIN32)
if (WITH_SERVER)
if (HAVE_LIBUTIL)
add_executable(samplesshd-tty samplesshd-tty.c)
- target_link_libraries(samplesshd-tty ${LIBSSH_SHARED_LIBRARY} util)
+ target_link_libraries(samplesshd-tty ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARIES} util)
endif (HAVE_LIBUTIL)
endif (WITH_SERVER)
diff --git a/examples/samplesshd-tty.c b/examples/samplesshd-tty.c
index 7ed70d3d..b9831855 100644
--- a/examples/samplesshd-tty.c
+++ b/examples/samplesshd-tty.c
@@ -25,7 +25,9 @@ clients must be made or how a client should react.
#include <string.h>
#include <stdio.h>
#include <poll.h>
+#ifdef HAVE_PTY_H
#include <pty.h>
+#endif
#define SSHD_USER "libssh"
#define SSHD_PASSWORD "libssh"