CMake Error: Could not find CMAKE_ROOT


I am getting that error again and again, when I check cmake --version
I have tried:

  • install as sudo … and from root user…
  • export CMAKE_ROOT=CMAKE_ROOT=/usr/local/share/cmake-3.23

still does not work

:warning: it works with sudo though…
(sudo 'which cmake' --version)

ps: on

  • centos 7


concerning cmake on centOS,

one needs to use Version 2.0.0 fails to install on R 4.0.2 · Issue #104 · astamm/nloptr · GitHub