If you are compiling the cmake-3.21.3 on Rocky Linux 8.5, and encounter the issues
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
The problem is easy to resolve, you just need to install the openssl and openssl-devel libraries
# dnf install openssl openssl-devel
You should be able to bootrap easily.
Alternatively, instead of using ./boostrap, you can use the traditional configure command
#./configure --prefix=/usr/local/cmake-3.21.3 # make # make install