Yuhan Wang
Yuhan Wang

Reputation: 81

brew upgrade cmake but the old version is still called

I am using MacOS High Sierra. I used brew to upgrade my cmake using the following command:

brew reinstall cmake

and it outputs as follows:

==> Reinstalling make 
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/cm
Already downloaded: /Users/johann/Library/Caches/Homebrew/downloads/51a1df944e29ccc6fc3ac4dc1bd54832f3cadf8d8627a3571b70c1e497464cf1--cmake-3.17.0_1.high_sierra.bottle.tar.gz
==> Pouring cmake-3.17.0_1.high_sierra.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/cmake
==> Summary
🍺  /usr/local/Cellar/cmake/3.17.0_1: 6,156 files, 60.4MB

it seems fine and I test cmake --version, the output is still correct

cmake version 3.17.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

However, when I use make to build a project (ignore the irrelevant details):

cmake --build . --target mpc

I receive an extremely confusing feedback, showing that it is somehow still calling the older version, and the files of the older versions have already been removed by brew.

make: /usr/local/Cellar/cmake/3.11.4/bin/cmake: No such file or directory
make: *** [cmake_check_build_system] Error 1

Could anyone please tell me what is happening and how can I make my new version cmake work actually?

Upvotes: 4

Views: 8437

Answers (1)

Yuhan Wang
Yuhan Wang

Reputation: 81

Problem Solved!

I was using cmake under a /build directory and this directory has already had some cmake cache, after I clean the folder and do configure again, there is no error anymore.

Thanks everyone for comment!

Upvotes: 4

Related Questions