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?
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.
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.