diff --git a/cmake/AddOpenSSL.cmake b/cmake/AddOpenSSL.cmake index ed68a48b6..e095d073f 100644 --- a/cmake/AddOpenSSL.cmake +++ b/cmake/AddOpenSSL.cmake @@ -4,11 +4,7 @@ message(CHECK_START "Adding OpenSSL") list(APPEND CMAKE_MESSAGE_INDENT " ") if (APPLE) - if (EXISTS "${POAC_HOMEBREW_ROOT_PATH}/openssl") - set(OPENSSL_ROOT_DIR "${POAC_HOMEBREW_ROOT_PATH}/openssl") - else () - message(FATAL_ERROR "OpenSSL not found. Please install it by `brew install openssl@3`") - endif () + set(OPENSSL_ROOT_DIR "${POAC_HOMEBREW_ROOT_PATH}/openssl") endif () if (DEFINED OPENSSL_ROOT_DIR) set(OPENSSL_LIBRARIES ${OPENSSL_ROOT_DIR}/lib) @@ -40,6 +36,10 @@ if (OPENSSL_FOUND) else () message(CHECK_FAIL "not found") list(APPEND missingDependencies openssl) + + if (APPLE) + message(FATAL_ERROR "OpenSSL not found. Please install it by `brew install openssl@3`") + endif () endif () list(POP_BACK CMAKE_MESSAGE_INDENT)