From 332cc0a418483cc69e76e1a91ba5e000118c8067 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 28 Sep 2015 07:42:35 -0400 Subject: [PATCH] Cmake: make libssh2 library path explicit Under certain conditions on my Mac the build process will happily find libssh2 but then at link time can't figure out where it is. Making the path to the library explicit seems to fix that issue. This commit also adds the code to dump all visible variables at the end of the cmake file (commented out). I have looked this up online, added it to address an issue, and then removed it quite a few times... I figure I might as well keep it there for the next time I need it. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2d299d91..3be81f5a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_LIBGIT23_API") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_LIBGIT23_API") if(FORCE_LIBSSH) - find_package(Libssh2 QUIET CONFIG) + find_package(Libssh2 QUIET CONFIG) if ("${LIBSSH2_VERSION}" STRGREATER "1.6.1") set(LIBSSH2_LIBRARIES Libssh2::libssh2) endif() @@ -98,7 +98,7 @@ else() if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "") pkg_config_library(LIBCURL libcurl REQUIRED) endif() - set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES}) + set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES}) endif() endif() @@ -813,3 +813,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ) endif() endif() +# get_cmake_property(_variableNames VARIABLES) +# foreach (_variableName ${_variableNames}) +# message(STATUS "${_variableName}=${${_variableName}}") +# endforeach()