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()
it works on Linux and on Mac, but on Mac it uses the osx-shipped libssl - which throws a a lot of deprecation warnings e.g. 'SSL_library_init' is deprecated: first deprecated in OS X 10.7"
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?