I've got the following lines in my CMakeLists.txt file. I'm running CMake 3.5.2 on Windows 7, and using Visual Studio 12 2013 as the generator with "Use default native compilers" checked in the gui.
find_path(FORTRAN_DIR NAMES cdll.cpp fdll.f90 Makefile PATHS ../source)
execute_process(COMMAND make
WORKING_DIRECTORY ${FORTRAN_DIR})
This runs just fine.
But exactly how is it being run?? It's on Windows!
I've compiled the Makefile via MSYS2 (MinGW) on Windows before, but if that's what CMake is using, then I'm not sure how it knows to do that.
Edit: I put execute_process(COMMAND uname -a)
into the CMakeLists.txt file and got MSYS_NT-6.1 MYCOMPUTERNAMEHERE 2.5.2(0.297/5/3) 2016-07-15 08:31 x86_64 Msys
. So I guess that answers that it's being run through MSYS... but how does CMake know to do this?
The documentation says:
"CMake executes the child process using operating system APIs directly. All arguments are passed VERBATIM to the child process. No intermediate shell is used, so shell operators such as > are treated as normal arguments."
But I don't understand what that means, especially considering that if I use the following line, I get /usr/bin/make
as the output:
execute_process(COMMAND which make)
What is happening, and/or how can I figure out what environment/shell/whatever these commands are being run in?