From 7c2489cc3dc798484e11a449fd0e305210de901b Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 14 12月 2019 20:12:41 +0800 Subject: [PATCH] fix codacy warnings --- CMakeLists.txt | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 939aeaf..a7543e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,17 +35,21 @@ ENDIF() SET (OPENSSL_USE_STATIC_LIBS ON) -find_package(OpenSSL COMPONENTS Crypto) +find_package(OpenSSL COMPONENTS Crypto QUIET) IF(OPENSSL_FOUND) MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION}") -ELSE(OPENSSL_FOUND) - MESSAGE(STATUS "OpenSSL not found") ENDIF(OPENSSL_FOUND) if(UNIX) #this is true for all the linux systems but not for cross compiling "linux->windows" IF(NOT OPENSSL_FOUND) MESSAGE(SEND_ERROR "Openssl required in Linux, please install it or specify -DOPENSSL_ROOT") ENDIF(NOT OPENSSL_FOUND) + + #Zlib required when openssl version < 1.0.1f (centos 7) + SET ( ZLIB_USE_STATIC_LIBS ON ) + find_package(ZLIB REQUIRED) + list(APPEND EXTERNAL_LIBS ${ZLIB_LIBRARIES}) + MESSAGE(STATUS "Found zlib version ${ZLIB_VERSION} ") find_package(Threads) if(THREADS_HAVE_PTHREAD_ARG) @@ -68,6 +72,9 @@ endif(USE_DBUS_IDENTIFIER) set(main_lib_dest "lib/${PROJECT_NAME}") else(UNIX) + IF(NOT OPENSSL_FOUND) + MESSAGE(STATUS "Openssl not found, configuring the library without it (running in wine not supported).") + ENDIF(NOT OPENSSL_FOUND) if(MSVC) include(target_arch) target_architecture( TARGET_ARCHITECTURE ) -- Gitblit v1.9.1