Could not find CMAKE_ROOT !!!

I downloaded cmake using following command

(base) pbaranw@enggpz1p23:~$ cmake_version=3.22.2
(base) pbaranw@enggpz1p23:~$ wget$cmake_version/cmake-$cmake_version.tar.gz

After this I am getting error

(base) pbaranw@enggpz1p23:~/cmake-3.22.2$ cmake -DCMAKE_BUILD_TYPE=Release .
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.

Can someone please help. Thank you

you forgot to untar the download. You’re still using CMake 3.10 there (instead of 3.22.2). Also, the install isn’t in your path, so try

./bin/cmake -DCMAKE_BUILD_TYPE=Release .