Page MenuHomePhabricator

CMake unable to find OpenSSL on MacOS X
Closed, ResolvedPublic

Description

To reproduce, on macos run:

mkdir -p build && cd build && cmake -GNinja ..

This should produce the following error:

CMake Error at /usr/local/Cellar/cmake/3.11.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.11.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.11.0/share/cmake/Modules/FindOpenSSL.cmake:390 (find_package_handle_standard_args)
  src/config/CMakeLists.txt:113 (find_package)

Event Timeline

confirming same issue for me.

when i pass OPENSSL_{ROOT,INCLUDE}_DIR cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2k/lib -GNinja .. I get complaint about missing ZMQ_ variables

when i pass the ZMQ paths cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2k/lib -DZMQ_LIBRARY=/usr/local/Cellar/zeromq/4.2.5/lib -DZMQ_INCLUDE_DIR=/usr/local/Cellar/zeromq/4.2.5/include -GNinja .. I get a new error

CMake Error at src/qt/CMakeLists.txt:8 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
BDBXX_LIBRARY
    linked by target "wallet" in directory /Users/dc/code/src/bitcoin-abc/src/wallet
BDB_LIBRARY (ADVANCED)
    linked by target "wallet" in directory /Users/dc/code/src/bitcoin-abc/src/wallet

-- Configuring incomplete, errors occurred!
See also "/Users/dc/code/src/bitcoin-abc/build/CMakeFiles/CMakeOutput.log".
See also "/Users/dc/code/src/bitcoin-abc/build/CMakeFiles/CMakeError.log".

This should be fixed now