Rate This Document
Findability
Accuracy
Completeness
Readability

New CMake Version Does Not Take Effect After CMake Is Upgraded

Symptom

After CMake is upgraded, the new version does not take effect.

Key Process and Cause Analysis

Another CMake version already exists in the environment and has a higher priority than the installed CMake version.

Conclusion and Solution

  1. Check for CMake in the environment.
    find / -name cmake | grep bin
  2. View the CMake versions.
    /usr/local/bin/cmake --version
    /usr/local/cmake/bin/cmake --version
  3. Make the newly installed CMake version take effect.
    cd /usr/local/bin/
    mv cmake cmake-3.18.2
    hash -r
    cmake --version