From c1f88ddd6988fa0ef1171a141120a8989de48960 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 19 Mar 2019 22:39:53 +0100 Subject: CMake: simplify code in HandleFindGit2 Signed-off-by: Rolf Eike Beer --- cmake/Modules/HandleFindGit2.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmake/Modules/HandleFindGit2.cmake') diff --git a/cmake/Modules/HandleFindGit2.cmake b/cmake/Modules/HandleFindGit2.cmake index 63877c9e1..ee1f1521b 100644 --- a/cmake/Modules/HandleFindGit2.cmake +++ b/cmake/Modules/HandleFindGit2.cmake @@ -16,22 +16,22 @@ else() include_directories(${LIBGIT2_INCLUDE_DIR}) if(FORCE_LIBSSH) find_package(Libssh2 QUIET CONFIG) - if ("${LIBSSH2_VERSION}" STRLESS "1.7" AND "${LIBSSH2_VERSION}" STRGREATER "1.6.1") + if (LIBSSH2_VERSION VERSION_LESS "1.7" AND LIBSSH2_VERSION VERSION_GREATER "1.6.1") set(LIBSSH2_LIBRARIES Libssh2::libssh2) endif() # at least on my Mac I get the mixed case variable instead... if(Libssh2_FOUND) set(LIBSSH2_FOUND ${Libssh2_FOUND}) endif() - if(!LIBSSH2_FOUND OR "${LIBSSH2_FOUND}" STREQUAL "") + if(NOT LIBSSH2_FOUND) pkg_config_library(LIBSSH2 libssh2 REQUIRED) endif() endif() find_package(libcurl QUIET) - if(!LIBCURL_FOUND OR "${LIBCURL_FOUND}" STREQUAL "") + if(NOT LIBCURL_FOUND) pkg_config_library(LIBCURL libcurl REQUIRED) endif() - if("${LIBSSH2_LIBRARY_DIRS}" STREQUAL "") + if(NOT LIBSSH2_LIBRARY_DIRS) set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES} -lcrypto) else() set(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -L${LIBSSH2_LIBRARY_DIRS} ${LIBSSH2_LIBRARIES} ${LIBCURL_LIBRARIES} -lcrypto) -- cgit v1.2.3-70-g09d2