[CMake] CMake execute_process command on bash on Windows

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri May 6 18:30:24 EDT 2016


On 2016-05-06 22:44+0100 Miklos Espak wrote:

> Hi,
>
> I want to run CMake from bash on Windows, but the configuration fails at
> the 'execute_command' calls in our CMakeLists files. The WORKING_DIRECTORY
> argument does not seem to make any effect. I got around it by prepending
> "cd <working dir> ; ..." before the command to execute. But then I got
> other problems. (The output was not stored in the output variable.)
>
> This was with CMake 3.3.2.
>
> Has anybody got experience with using CMake from bash on Windows? Has
> anybody tried?

To help others here understand any issues you have encountered, I
suggest you should indicate the source of the bash.exe that you are
using, what kind of Windows (Cygwin, MinGW-w64/MSYS2, MinGW/MSYS,
or bare Windows?), and what generator you are using.

I have no recent first-hand experience myself, but as the guy who
collects test reports from PLplot users I have heard lots of
second-hand reports that our test system (based on CMake custom
commands that run bash test scripts) works well for Cygwin,
MinGW-w64/MSYS2, and MinGW/MSYS.  Also, one of the PLplot developers
tried the idea of putting bash.exe (from Cygwin, IIRC) on the PATH and
then running PLplot tests for the MSVC case, but he could not get it
to work for reasons he could not understand. I thought at the time
there might have been issues about the way he was manipulating the
PATH directly from Windows so I suggested instead he run bash.exe, and
set the PATH (and other required environment variables) from bash
using a known file filled with export commands that he "source"d, but
he never followed up with that experiment. So from my perspective the
"jury is still out" on the combination of CMake, bash, and MSVC, but
that combination should be fine on the other Windows platforms I have
mentioned.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list