CMake 代码语法错误 FindOpenSSL.cmake:422 解析字符串时

Syntax error in CMake code at FindOpenSSL.cmake:422 when parsing string

CMake Error at /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindOpenSSL.cmake:421 (file):
  Syntax error in cmake code at

    /usr/local/Cellar/cmake/3.17.3/share/cmake/Modules/FindOpenSSL.cmake:422

  when parsing string

    ^#[\t ]*define[\t ]+OPENSSL_VERSION_STR[\t ]+\"([0-9])+\.([0-9])+\.([0-9])+\".*

  Invalid escape sequence \.
Call Stack (most recent call first):
  CMakeLists.txt:8 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!

我已经安装了 OpenSSL,但我不知道为什么 CMake 不让我 运行 代码。

此问题是 CMake 版本 3.17.3 中引入的 错误,请参阅提交 here。代码更改旨在更新 CMake 解析 OpenSSL 版本号的方式,但 CMake 维护人员使用的正则表达式格式不正确。

问题已在 CMake 3.18.0-rc1 here, so if you upgrade to the latest CMake 版本中快速修复,问题将得到解决。