CMake Error: Could Not Find OpenSSL

痴心易碎 提交于 2019-12-08 05:25:12

问题


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?


回答1:


I've previously had the same problem.

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




回答2:


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.



来源:https://stackoverflow.com/questions/39696840/cmake-error-could-not-find-openssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!