Re: [cmake-developers] [CMake] FIND_PROGRAM fails to find file without 'r' bit set
On 01/25/2016 08:27 AM, Ben Boeckel wrote: > 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. There are related issues here: https://cmake.org/Bug/view.php?id=14022 https://cmake.org/Bug/view.php?id=10468 The main compatibility concern is not about find_program, but just about other uses of FileExists. Each time this has come up before we've determined the full solution requires a non-trivial audit of all uses of FileExists. That lost sight of the immediate find_program problem, so instead we could look at fixing just that. Since then we've gained the cmSystemTools::TestFileAccess() function. One could look at porting find_program to use it with TEST_FILE_EXECUTE. The Tests/RunCMake/find_program test could be extended to cover this once it is fixed. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
Re: [cmake-developers] [CMake] FIND_PROGRAM fails to find file without 'r' bit set
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 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
[cmake-developers] [CMake] FIND_PROGRAM fails to find file without 'r' bit set
Hello, 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? Best Regards, Vyacheslav Barinov -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers