Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set CLion custom CMake executable to a version installed with Homebrew?

I'm trying to make CLion use the same version of CMake that I'm using from the command line. In Preferences > Build, Execution, Deployment > Toolchains, I tried setting a custom CMake executable path to /usr/local/Cellar/cmake/3.7.0/bin, but CMake displays a "not found" error on the same page.

For now, I had brew install the same version of CMake that CLion is using: brew switch cmake 3.6.2

But is there a way to make CLion use the version of cmake installed with brew?

like image 502
Peter Tseng Avatar asked Jan 05 '23 23:01

Peter Tseng


1 Answers

Yes, you can set your own cmake binary for use in Clion.

You're on the right track, go to Preferences > Build, Execution, Deployment > Toolchains just as you did, and set CMake executabl -> Custom to

 /usr/local/Cellar/cmake/3.7.0/bin/cmake

Note, your're supposed to put the absolute name of your own cmake here, not only the path to the directory containing cmake.

like image 120
Anders Avatar answered Jan 17 '23 16:01

Anders