summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2015-01-24 16:15:12 +0200
committerRaphael Kubo da Costa <rakuco@FreeBSD.org>2015-01-25 22:33:34 +0200
commit461fd5a0c75cbe62dcdd3de23b84e27deb3ded8b (patch)
treeb1c756da43a42451943f0598d02ed3015e76d72a
parent73c5db7663b16f8aee2176ae8a5a4ed5127d5c35 (diff)
downloadlibgit2-461fd5a0c75cbe62dcdd3de23b84e27deb3ded8b.tar.gz
Add libssh2's library and include directories.
Follow-up to 4f91bfa ("Find libssh2 via pkg-config"): FindPkgConfig sets <foo>_INCLUDE_DIRS, not <foo>_INCLUDE_DIR like FindLIBSSH2 did. Additionally, if using only FindPkgConfig to find libssh2, we have to call LINK_DIRECTORIES() as well to pass the appropriate -L entries, otherwise the build will only work if libssh2.so is in a directory searched automatically by the linker.
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0f01bbb5..704b4597d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -218,7 +218,8 @@ IF (USE_SSH)
ENDIF()
IF (LIBSSH2_FOUND)
ADD_DEFINITIONS(-DGIT_SSH)
- INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIR})
+ INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIRS})
+ LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS})
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2")
SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES})
ENDIF()