[cmake-developers] Expected difference in execute_process between MSYS / UNIX

Richard Shaw hobbes1069 at gmail.com
Fri Oct 31 09:06:45 EDT 2014


On Thu, Oct 30, 2014 at 2:25 PM, Brad King <brad.king at kitware.com> wrote:

> On 10/30/2014 01:55 PM, Richard Shaw wrote:
> > I'm working on a big update to the FindFLTK module and I'm
> > testing it on all platforms I have access to.
> >
> > One problem that took me quite a while to figure out was that
> > on *nix systems, execute_process works with shell scripts but
> > on my MSYS2 install it does not, I have to prefix the command
> > with "sh" to make sure it executes in a shell.
> >
> > Is this known/expected?
>
> Yes.  It is not execute_process, but the underlying operating
> system process launching rules.  A shell script starts in a
> "shebang" (#!) line that the OS knows how to interpret to
> decide what program to run to launch the script.  Windows does
> not know how to do this so we have to specify a shell explicitly.
> MSYS is Windows, not POSIX/Cygwin.
>

I figured as much but wanted to verify.


> Should I prefix shell scripts with "sh" in all cases and not
> > count on it to work? Or should I test for MSYS and only prefix
> > the command with "sh" there?
>
> Using 'sh' should be safe.


Good to know. Thanks!

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141031/abf55493/attachment.html>


More information about the cmake-developers mailing list