aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--ConfigureChecks.cmake4
-rw-r--r--examples/CMakeLists.txt5
3 files changed, 9 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 445710a0..30b1025c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,6 +74,10 @@ if (WITH_NACL)
endif (NOT NACL_FOUND)
endif (WITH_NACL)
+if (BSD OR SOLARIS OR OSX)
+ find_package(Argp)
+endif (BSD OR SOLARIS OR OSX)
+
# config.h checks
include(ConfigureChecks.cmake)
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 9109d8fc..3d23bfd6 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -47,7 +47,11 @@ int main(void){ return 0; }
endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW AND NOT OS2)
# HEADER FILES
+set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ARGP_INCLUDE_DIRS})
check_include_file(argp.h HAVE_ARGP_H)
+set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+
check_include_file(pty.h HAVE_PTY_H)
check_include_file(utmp.h HAVE_UTMP_H)
check_include_file(termios.h HAVE_TERMIOS_H)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 4998f041..6f9d6ef3 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -8,13 +8,10 @@ set(examples_SRCS
include_directories(
${LIBSSH_PUBLIC_INCLUDE_DIRS}
+ ${ARGP_INCLUDE_DIRS}
${CMAKE_BINARY_DIR}
)
-if (BSD OR SOLARIS OR OSX)
- find_package(Argp)
-endif (BSD OR SOLARIS OR OSX)
-
if (UNIX AND NOT WIN32)
add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})