CentOS7 and OpenSSL 1.1

Similar to QNX7.0 and openssl 1.1.1, on CentOS 7 (at least) OpenSSL 1.1 is installed as openssl11. On CMake 3.23.2, this causes the pkg_check_modules(_OPENSSL QUIET openssl) in FindOpenSSL.cmake to fail.

Has this by chance been addressed in a later release?

There were some recent OpenSSL-on-QNX fixes for 3.24. I’d recommend testing it and reporting back if it doesn’t work.

Looks like FindOpenSSL.cmake hasn’t been updated.

I was thinking changing that line to

pkg_search_module(_OPENSSL QUIET openssl11 openssl)

should do it, but I have no confidence in me.

Here’s the MR I’m referring to: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7232

I only mentioned the QNX link because it was a similar issue. I don’t think that will address the CentOS 7 problem of not finding “openssl11” as an alias for “openssl”.

CentOS/RHEL is notorious for handling parallel package versions by giving them new names. pkg_search_module seems tailor made for this purpose.

Please file an issue in that case.

As explained in the FindOpenSSL.cmake configuration file and in this StackOverflow post, you can install an alternative version of OpenSSL at a different location, for example /usr/local/openssl and then use export OPENSSL_ROOT_DIR=/usr/local/openssl for CMake to use the newer installation.