CMake missing modules directory

Additionally, you may encounter the same error when running CMake from Cygwin. This may be caused by a PATH variable listing /bin before /usr/bin: in this case CMake is launched as /bin/cmake instead of /usr/bin/cmake, and trying to load modules from //share/cmake-X.Y.Z (which is a UNC path on Windows) instead of /usr/share/cmake-X.Y.Z.

Explicitly export'ing a correct CMAKE_ROOT isn't helpful, and cmake keeps displaying the same misleading message.

The issue can be solved by setting PATH to /usr/bin:/bin:/everything/else in your .bash_profile.


Do hash -r to clear the cache, then do cmake --version.

It should work.


I had the same problem after upgrading on Ubuntu. Removing cmake and the cmake-data package before performing the update solved it for me.

sudo apt-get remove cmake cmake-data

Now perform the update via

sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake

This worked for me :

cd cmake-3.4.3

./bootstrap --prefix=/usr

make

sudo make install

Tags:

Cmake