且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cmake无法找到openssl

更新时间:2022-04-23 16:59:11

误解:CMake不需要环境变量来知道库和包含dir的位置是否是CMake变量。

It is a common misunderstanding: CMake does not need environment variables to know where the library and include dir are but CMake variables.

由于CMake找不到您的OpenSSL库和include目录,当你打电话时,必须手动告诉他他们在它的命令行。使用选项 -D 在命令行中设置CMake中的常量。您将需要设置常量 OPENSSL_ROOT_DIR OPENSSL_LIBRARIES ,因为它们是触发错误的常量。

Since CMake can not find your OpenSSL lib and include directory, you will have to manually tell him where they are with its command line when you call it. Use the option -D to set constants in CMake from the command line. You will need to set the constants OPENSSL_ROOT_DIR and OPENSSL_LIBRARIES since they are the one triggering the error.

cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib