diff --git a/cpp/Brewfile b/cpp/Brewfile index 66f1bd332bbf9..580e8d3f115d5 100644 --- a/cpp/Brewfile +++ b/cpp/Brewfile @@ -30,7 +30,7 @@ brew "grpc" brew "llvm@14" brew "lz4" brew "ninja" -brew "openssl@1.1" +brew "openssl@3" brew "protobuf" brew "python" brew "rapidjson" diff --git a/cpp/cmake_modules/FindOpenSSLAlt.cmake b/cpp/cmake_modules/FindOpenSSLAlt.cmake index f027eb1026dde..de56e1bc0b8ce 100644 --- a/cpp/cmake_modules/FindOpenSSLAlt.cmake +++ b/cpp/cmake_modules/FindOpenSSLAlt.cmake @@ -22,17 +22,24 @@ endif() if(APPLE AND NOT OPENSSL_ROOT_DIR) find_program(BREW brew) if(BREW) - execute_process(COMMAND ${BREW} --prefix "openssl@1.1" - OUTPUT_VARIABLE OPENSSL11_BREW_PREFIX + execute_process(COMMAND ${BREW} --prefix "openssl" + OUTPUT_VARIABLE OPENSSL_BREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) - if(OPENSSL11_BREW_PREFIX) - set(OPENSSL_ROOT_DIR ${OPENSSL11_BREW_PREFIX}) + if(OPENSSL_BREW_PREFIX) + set(OPENSSL_ROOT_DIR ${OPENSSL_BREW_PREFIX}) else() - execute_process(COMMAND ${BREW} --prefix "openssl" - OUTPUT_VARIABLE OPENSSL_BREW_PREFIX + execute_process(COMMAND ${BREW} --prefix "openssl@3.0" + OUTPUT_VARIABLE OPENSSL3_BREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) - if(OPENSSL_BREW_PREFIX) - set(OPENSSL_ROOT_DIR ${OPENSSL_BREW_PREFIX}) + if(OPENSSL11_BREW_PREFIX) + set(OPENSSL_ROOT_DIR ${OPENSSL3_BREW_PREFIX}) + else() + execute_process(COMMAND ${BREW} --prefix "openssl@1.1" + OUTPUT_VARIABLE OPENSSL11_BREW_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(OPENSSL11_BREW_PREFIX) + set(OPENSSL_ROOT_DIR ${OPENSSL11_BREW_PREFIX}) + endif() endif() endif() endif()