In the last step: make -C build
The process fails with the message:
[ 65%] Linking C shared library ../../../../lib/libcurl.dylib ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [lib/libcurl.dylib] Error 1 make[1]: *** [cpr/opt/curl/lib/CMakeFiles/libcurl.dir/all] Error 2 make: *** [all] Error 2
Note: I have set the PATH_TO_OPENSSL_HEADERS in the command to /usr/local/opt/openssl/include as instructed in the README
I think I found a working solution here. A lot of other solutions out there recommend doing crazy things like removing your system library files and symlinking from the homebrew install. That is hacky as hell and I needed a reproducible solution.
After digging around in CMake’s FinOpenSSL.cmake file a bit it appears that even when you specify -DOPENSSL_ROOT_DIR and point it to your homebrew openssl install, it doesn’t find the crypto lib in the same path. After more digging I found you can override this library path from the command line using -DOPENSSL_CRYPTO_LIBRARY.