I installed the latest version of OpenSSL (1.0.2q) via macports and I'm trying to build a project on my mac that depends on OpenSSL and found that CMake seems to be returning the wrong library path or the wrong include path:
message("@@@")
message(${OPENSSL_INCLUDE_DIR})
message(${OPENSSL_SSL_LIBRARY})
message("/@@@")
prints:
@@@
/opt/local/include
/usr/lib/libssl.dylib
/@@@
So it gives me headers for OpenSSL from macports and the library from system.
I found this because building an external library fails with linking errors:
Undefined symbols for architecture x86_64:
"_X509_check_host", referenced from:
_ma_tls_verify_server_cert in libmariadbclient.a(openssl.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I make CMake find and use macports libraries only?