From 8acd0089c42c24bb7d37d8250e08867e0bd72a0f Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周日, 01 12月 2019 13:44:00 +0800 Subject: [PATCH] fix centos --- CMakeLists.txt | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 882174e..acd00fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,17 +52,23 @@ 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} ") +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 not found - required in Linux") + ENDIF(NOT OPENSSL_FOUND) find_package(Threads) if(THREADS_HAVE_PTHREAD_ARG) -- Gitblit v1.9.1