diff options
Diffstat (limited to 'project/cmake/modules/FindSSH.cmake')
| -rw-r--r-- | project/cmake/modules/FindSSH.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/project/cmake/modules/FindSSH.cmake b/project/cmake/modules/FindSSH.cmake new file mode 100644 index 0000000..60c3537 --- /dev/null +++ b/project/cmake/modules/FindSSH.cmake | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | # - Try to find libssh | ||
| 2 | # Once done this will define | ||
| 3 | # | ||
| 4 | # SSH_FOUND - system has libssh | ||
| 5 | # SSH_INCLUDE_DIRS - the libssh include directory | ||
| 6 | # SSH_LIBRARIES - The libssh libraries | ||
| 7 | |||
| 8 | if(PKG_CONFIG_FOUND) | ||
| 9 | pkg_check_modules (SSH libssh) | ||
| 10 | list(APPEND SSH_INCLUDE_DIRS /usr/include) | ||
| 11 | else() | ||
| 12 | find_path(SSH_INCLUDE_DIRS libssh/libssh.h) | ||
| 13 | find_library(SSH_LIBRARIES ssh) | ||
| 14 | endif() | ||
| 15 | |||
| 16 | include(FindPackageHandleStandardArgs) | ||
| 17 | find_package_handle_standard_args(SSH DEFAULT_MSG SSH_INCLUDE_DIRS SSH_LIBRARIES) | ||
| 18 | |||
| 19 | list(APPEND SSH_DEFINITIONS -DHAVE_LIBSSH=1) | ||
| 20 | |||
| 21 | mark_as_advanced(SSH_INCLUDE_DIRS SSH_LIBRARIES SSH_DEFINITIONS) | ||
