Findopenssl.cmake无法找到OpenSSL,编译Restbed,C ++ [英] Findopenssl.cmake fails to find OpenSSL, compiling restbed, C++

查看:387
本文介绍了Findopenssl.cmake无法找到OpenSSL,编译Restbed,C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Debian 9.7上使用cmake 3.7.2来编译restbed(用于Web服务的C ++框架)。

I'm trying to use cmake 3.7.2 on Debian 9.7 to compile restbed, a C++ framework for web services.

我遵循自述文件中的说明。他们很直接。

I follow the readme instructions. they're straight forward.

git clone --recursive https://github.com/corvusoft/restbed.git
mkdir restbed/build
cd restbed/build
cmake [-DBUILD_SSL=NO] ..
make install
make test

但是运行cmake时出现以下错误:

But i get the following error when running cmake:

-- Found ASIO include at: /home/ben/Workspaces/C_Experiments/restbed/dependency/asio/asio/include
-- Found Catch include at: /home/ben/Workspaces/C_Experiments/restbed/dependency/catch/single_include
CMake Error at cmake/Findopenssl.cmake:23 (message):
  Failed to locate OpenSSL dependency.  see restbed/dependency/openssl;
  ./config shared; make all
Call Stack (most recent call first):
  CMakeLists.txt:47 (find_package)

因此,我检查了Findopenssl.cmake,发现它在许多地方查找该库。

So I check Findopenssl.cmake, and find that it's looking in a number of places for the libraries.

find_library( ssl_LIBRARY_STATIC libssl.a  ssleay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
find_library( crypto_LIBRARY_STATIC libcrypto.a libeay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )

find_library( ssl_LIBRARY_SHARED libssl.so libssl.dylib ssleay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
find_library( crypto_LIBRARY_SHARED libcrypto.so libcrypto.dylib libeay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )

find_path( ssl_INCLUDE openssl/ssl.h HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/inc32" "${PROJECT_SOURCE_DIR}/dependency/openssl/include" "/usr/local/opt/openssl/include" "/usr/include" "/usr/local/include" "/opt/local/include" )

if ( ssl_LIBRARY_STATIC AND ssl_LIBRARY_SHARED AND crypto_LIBRARY_STATIC AND crypto_LIBRARY_SHARED )
    set( OPENSSL_FOUND TRUE )
    add_definitions( -DBUILD_SSL=TRUE )

    if ( APPLE AND BUILD_SSL )
        set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
    endif( )

    message( STATUS "Found OpenSSL include at: ${ssl_INCLUDE}" )
    message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_STATIC}" )
    message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_SHARED}" )
    message( STATUS "Found Crypto library at: ${crypto_LIBRARY_STATIC}" )
    message( STATUS "Found Crypto library at: ${crypto_LIBRARY_SHARED}" )
else ( )
    message( FATAL_ERROR "Failed to locate OpenSSL dependency. see restbed/dependency/openssl; ./config shared; make all" )
endif ( )

我也找不到这些文件。我安装了openssl,版本1.1.0

I can't find these file either. I have openssl installed, version 1.1.0

我在这里缺少什么明显的东西?

What obvious thing am I missing here?

谢谢

推荐答案

尝试使用不带括号的 cmake 命令:

Try using the cmake command without brackets:

cmake -DBUILD_SSL=NO ..

这篇关于Findopenssl.cmake无法找到OpenSSL,编译Restbed,C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆