[CMake] $ENV{HOSTNAME}

Salvatore Iovene salvatore.iovene+cmake at googlemail.com
Wed Nov 21 08:58:54 EST 2007


On Nov 21, 2007 3:56 PM, Gonzalo Garramuño <ggarra at advancedsl.com.ar> wrote:
> Salvatore Iovene wrote:
> >
> > A bug? Thanks.
> >
>
> Nope.
>
> $ echo $HOSTNAME
> aura1
>
> $ sh -c "echo \$HOSTNAME"
>
> $ bash -c "echo \$HOSTNAME"
> aura1
>
> Basically, HOSTNAME is a variable that is set by some shells like bash
> only, but cmake for speed and consistency runs commands using the most
> basic unix shell (ie. sh), which does not set that variable by default.

Thanks. How can I work this around? I really need to get the HOSTNAME in a
shell-independent way. Maybe there's a way to execute the `hostname`
command?


More information about the CMake mailing list