I am using the following cmake commands
# Search OpenSSL
find_package(PkgConfig REQUIRED)
pkg_search_module(OPENSSL REQUIRED openssl)
if( OPENSSL_FOUND )
in
The cause of this issue is a bug in CMake -- it does not use alternate pkg-config
paths correctly.
According to the merge request attached to the bug, the fix should be in cmake 3.17.0 (to be released in Feb 2020).
Otherwise, use this work-around. Hard coding it in your CMakeLists.txt
will make things bad for people who use MacPorts instead of Homebrew.