[cmake-developers] [CMake] FIND_PROGRAM fails to find file without 'r' bit set

Ben Boeckel ben.boeckel at kitware.com
Mon Jan 25 08:27:58 EST 2016


On Mon, Jan 25, 2016 at 16:06:47 +0300, Vyacheslav Barinov wrote:
> I try to detect paths to some tools using CMake and got the following problem:
> if the tool I try to check has 611 (-rw--x--x) rights FIND_PROGRAM reports the
> file does not exists.
> 
> For instance my /bin/mount in Gentoo has such setup and therefore I can use it
> from shell but can't detect it from CMakeLists.txt.
> 
> Is it bug or normal behavior for CMake?

It's both :) . FileExists is implemented using access() rather than
something like lstat(), so that would indeed be not a "program" since
the file doesn't "exist".

It was on my list to fix, but the backwards compatibility argument
(IIRC) made it near impossible to change.

--Ben


More information about the cmake-developers mailing list