问题描述
我正在使用以下cmake命令
i am using the following cmake commands
# Search OpenSSL
find_package(PkgConfig REQUIRED)
pkg_search_module(OPENSSL REQUIRED openssl)
if( OPENSSL_FOUND )
include_directories(${OPENSSL_INCLUDE_DIRS})
message(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
else()
# Error; with REQUIRED, pkg_search_module() will throw an error by it's own
endif()
它可以在Linux和Mac上运行-但在Mac上它使用osx附带的libssl-会抛出很多弃用警告,例如'SSL_library_init' is deprecated: first deprecated in OS X 10.7"
it works on linux and on Mac - but on mac it uses the osx-shipped libssl - wich throws a alot of deprecation warnings e.g. 'SSL_library_init' is deprecated: first deprecated in OS X 10.7"
使用brew
我已经安装了更新的-openssl-offical-libssl-如何告诉cmake中的pkg_search_module
查找并使用Brew版本?
using brew
i already installed a newer - openssl-offical - libssl - how can i tell the pkg_search_module
in cmake to find and use the brew version?
致谢
推荐答案
确定可以正常使用:)
brew upgrade openssl
brew link --force openssl
pkg-config --modversion openssl
#1.0.2
删除了cmake构建文件夹并重新运行cmake ..
,以上宏现在找到了1.0.2 libssl:)
removed the cmake build folder and rerun the cmake ..
and the above macro now finds the 1.0.2 libssl :)
这篇关于cmake-osx/mac-openssl brew的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!