CMake does not work when parent directory of cmake executable is symbolic link to directory not ending in "bin"
Default value of CMAKE_BIN_DIR
is bin
.
CMake in probably all distributions is distributed with this default value.
System administrator can configure /usr/bin
to be symbolic link to some other directory.
At run time, when calling cmake
(even as /usr/bin/cmake
), argv0
is canonicalized path by operating system, so it is something else than /usr/bin/cmake
.
CMake contains incorrect code which checks if canonicalized actual path ends with uncanonicalized expected suffix (set at build time of CMake).
Comparison of canonicalized path and uncanonicalized path is bad idea. Checking suffix in this way is also bad idea, because for not installed CMake in somethingbin
directory false positive result will occur.
$ cmake ${source_directory}
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.