CMake Error: Could Not Find OpenSSL

2019-06-02 17:33发布

My Objective:

I'm trying to configure Mosquitto broker to use websockets.

The Warnings and Errors:

https://docs.google.com/document/d/1HJ75NO1wBsnNfFFszeXP4p8re7m4gTE_CMbFoSswJJs/edit?usp=sharing

Software:

  • Windows 10 x64
  • libwebsockets-master
  • Cmake 3.6.2 win32
  • OpenSSL 1.1.0a
  • Visual Studio 14 2015 (with C++ compiler)

What I've tried:

I'm using CMake gui cause I'm not really familiar with the commands. I configure the source and destination and set the following variables as paths and filepaths respectively:

  • OPENSSL_ROOT_DIR = OpenSSL-Win32
  • OPENSSL_LIBRARIES = OpenSSL-Win32/lib or OpenSSL-Win32/lib/openssl.lib
  • OPENSSL_CONF = bin\openssl.cfg
  • OPENSSL_INCLUDE_DIR = OpenSSL-Win32/include/openssl

I tried setting the OPENSSL_LIBRARIES in the libwesocket's CMkakeLists.txt file too. I've used multiple different versions of CMake and OpenSSL. I tried opening CMake with VS command line (as admin).

I've previously built a .sln file with older out-dated OpenSSL so there's no issue with the compiler.

I've looked at the questions here, here, here and here. If it boils down to using the command line specifically to set OPENSSL_ROOT_DIR, could someone shed some light on this please?

2条回答
【Aperson】
2楼-- · 2019-06-02 17:48

I also ran into the same error when building libwebsockets. I added the following entry in cmake-gui:

OPENSSL_ROOT_DIR = C:/OpenSSL-Win32

I did not add the other OPENSSL variables at all, and it seemed like cmake was able to derive those.

查看更多
▲ chillily
3楼-- · 2019-06-02 18:00

I've previously had the same problem.

Try changing OPENSSL_LIBRARIES path to OpenSSL-Win32/lib/vc.

查看更多
登录 后发表回答