c – 如何修复CMake中丢失的库错误?

我正在设置一个新服务器,CMake 3.14.0-rc1向我发送错误消息.我在这里尝试一些解决方案,但我找不到正确的解决方案.

"CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenSSL (missing: OPENSSL_LIBRARIES)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  src/cmake/macros/FindOpenSSL.cmake:184 (find_package_handle_standard_args)
  CMakeLists.txt:92 (find_package)"

这是消息.
我手动添加缺少的条目但不起作用. (Windows 10和OpenSSL 1.1.1a版不轻装.

谢谢大家可以帮我解决问题.

最佳答案 CMake自动调用函数
FindOpenSSL

FindOpenSSL

Find the OpenSSL encryption library.
This module will set the following variables in your project:

OPENSSL_FOUND
System has the OpenSSL library.

OPENSSL_INCLUDE_DIR
The OpenSSL include directory.

OPENSSL_CRYPTO_LIBRARY
The OpenSSL crypto library.

OPENSSL_SSL_LIBRARY
The OpenSSL SSL library.

OPENSSL_LIBRARIES
All OpenSSL libraries.

OPENSSL_VERSION
This is set to $major.$minor.$revision$patch (e.g. 0.9.8s).

然而,缺少OPENSSL_LIBRARIES;它通常意味着需要在开发环境中安装openssl.你通常需要devel包.

点赞