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

Viewed 498
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!

I've installed OpenSSL, but I don't know why CMake won't let me run the code.

1 Answers

This issue is a bug introduced in CMake version 3.17.3, see the commit here. The code change was intended to update the how CMake parses the OpenSSL version number, but the regex used by the CMake maintainers was malformed.

The issue was quickly patched in CMake 3.18.0-rc1 here, so if you upgrade to the latest CMake version the issue will be resolved.

Related