[CMake] find_program refuse find su and sudo

Serghei Amelian serghei.amelian at gmail.com
Sun Sep 12 08:01:59 EDT 2010


Hello,

I try to check where are located su and sudo and, guess what, cmake do not 
want to find it :) Maybe it's because sudo and su are suid-ed, but this is 
not documented.

This is a little script and output:

##############
cmake_minimum_required( VERSION 2.6 )

project( test )

find_program( VAR_LS ls )
find_program( VAR_TAR tar )
find_program( VAR_SU su )
find_program( VAR_SUDO sudo )

message( STATUS ${VAR_LS} )
message( STATUS ${VAR_TAR} )
message( STATUS ${VAR_SU} )
message( STATUS ${VAR_SUDO} )
###############

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- /bin/ls
-- /bin/tar
-- VAR_SU-NOTFOUND
-- VAR_SUDO-NOTFOUND
-- Configuring done
-- Generating done

Of course I have su and sudo installed:

# which sudo su
/usr/bin/sudo
/bin/su

Any clue?

-- 
Serghei


More information about the CMake mailing list