From 04739e9f4a10327e3041cd4b2f7ca631a14dab9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 30 Apr 2014 10:15:44 +0200 Subject: [PATCH 1/3] Unquiet CMake output The point of this phase is to know what we have and not. Show the user a clear indication of what we have. --- CMakeLists.txt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a3890152..e7701429c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,7 @@ ELSE () FIND_PACKAGE(OpenSSL) ENDIF () - FIND_PACKAGE(HTTP_Parser QUIET) + FIND_PACKAGE(HTTP_Parser) IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS}) LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES}) @@ -174,9 +174,7 @@ IF(WIN32 OR AMIGA OR ANDROID) ENDIF() # Optional external dependency: zlib -# It's optional, but FIND_PACKAGE gives a warning that looks more like an -# error. -FIND_PACKAGE(ZLIB QUIET) +FIND_PACKAGE(ZLIB) IF (ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) LINK_LIBRARIES(${ZLIB_LIBRARIES}) @@ -185,8 +183,6 @@ IF (ZLIB_FOUND) ELSE() SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") ENDIF() - # Fake the message CMake would have shown - MESSAGE(STATUS "Found zlib: ${ZLIB_LIBRARY}") ELSE() MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." ) INCLUDE_DIRECTORIES(deps/zlib) @@ -196,7 +192,7 @@ ENDIF() # Optional external dependency: libssh2 IF (USE_SSH AND NOT MINGW) - FIND_PACKAGE(LIBSSH2 QUIET) + FIND_PACKAGE(LIBSSH2) ENDIF() IF (LIBSSH2_FOUND) ADD_DEFINITIONS(-DGIT_SSH) @@ -207,7 +203,7 @@ ENDIF() # Optional external dependency: iconv IF (USE_ICONV) - FIND_PACKAGE(ICONV QUIET) + FIND_PACKAGE(ICONV) ENDIF() IF (ICONV_FOUND) ADD_DEFINITIONS(-DGIT_USE_ICONV) From 096ac799a37e235d894641f2974a6d6105e41d4c Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Thu, 13 Feb 2014 22:38:23 +0800 Subject: [PATCH 2/3] Workaround missing .pc files on FreeBSD This fixes #2118 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7701429c..ac75ebbcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,11 @@ IF (WIN32 AND NOT MINGW AND NOT SHA1_TYPE STREQUAL "builtin") FILE(GLOB SRC_SHA1 src/hash/hash_win32.c) ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin") ADD_DEFINITIONS(-DOPENSSL_SHA1) - SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl") + IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lssl") + ELSE() + SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl") + ENDIF () ELSE() FILE(GLOB SRC_SHA1 src/hash/hash_generic.c) ENDIF() @@ -178,7 +182,7 @@ FIND_PACKAGE(ZLIB) IF (ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) LINK_LIBRARIES(${ZLIB_LIBRARIES}) - IF(APPLE) + IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lz") ELSE() SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") From f5fc63bc0cdc19250b384ea62e2e1796128831ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 30 Apr 2014 10:55:58 +0200 Subject: [PATCH 3/3] Don't exclude libssh2 from MinGW It reportedly works. It does not however work when cross-compiling on Travis, so let's disable it there. This fixes #2311. --- .travis.yml | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f25ff7681..fcae726dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: fast_finish: true include: - compiler: i586-mingw32msvc-gcc - env: OPTIONS="-DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON" + env: OPTIONS="-DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF" - compiler: gcc env: COVERITY=1 allow_failures: diff --git a/CMakeLists.txt b/CMakeLists.txt index ac75ebbcb..b5bd669f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,7 +195,7 @@ ELSE() ENDIF() # Optional external dependency: libssh2 -IF (USE_SSH AND NOT MINGW) +IF (USE_SSH) FIND_PACKAGE(LIBSSH2) ENDIF() IF (LIBSSH2_FOUND)