From 4e71831e0504eb4792a98db0f177897b0429bd10 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周日, 01 12月 2019 20:31:00 +0800 Subject: [PATCH] submodule update --- CMakeLists.txt | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 882174e..70fb867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,17 +52,25 @@ add_definitions("/D _CRT_SECURE_NO_WARNINGS") else(MSVC) if(MINGW) - list(APPEND EXTERNAL_LIBS "-lcrypt32 -lws2_32 -liphlpapi") + list(APPEND EXTERNAL_LIBS "-lcrypt32 -lbcrypt -lws2_32 -liphlpapi") SET(CMAKE_EXE_LINKER_FLAGS "-static") endif(MINGW) endif(MSVC) -if(UNIX) #this is true for all the linux systems but not for cross compiling "linux->windows" - #find a static version of openssl crypto library - SET ( OPENSSL_USE_STATIC_LIBS ON ) - find_package(OpenSSL REQUIRED COMPONENTS Crypto) +SET ( OPENSSL_USE_STATIC_LIBS ON ) +find_package(OpenSSL COMPONENTS Crypto) +IF(OPENSSL_FOUND) + add_definitions(-DHAS_OPENSSL) include_directories(${OPENSSL_INCLUDE_DIR}) - MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION} ") + 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) find_package(Threads) if(THREADS_HAVE_PTHREAD_ARG) -- Gitblit v1.9.1