aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index fb312f8c..a4a19524 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -8,10 +8,13 @@ set(examples_SRCS
include_directories(
${LIBSSH_PUBLIC_INCLUDE_DIRS}
- ${ARGP_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
)
+if (ARGP_INCLUDE_DIR)
+ include_directories(${ARGP_INCLUDE_DIR})
+endif()
+
if (UNIX AND NOT WIN32)
add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})
@@ -30,7 +33,7 @@ if (UNIX AND NOT WIN32)
add_executable(samplessh sample.c ${examples_SRCS})
target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY})
- if (WITH_SERVER)
+ if (WITH_SERVER AND ARGP_LIBRARY)
if (HAVE_LIBUTIL)
add_executable(ssh_server_fork ssh_server_fork.c)
target_link_libraries(ssh_server_fork ${LIBSSH_SHARED_LIBRARY} ${ARGP_LIBRARY} util)