cmake -E chdir fails with "The system cannot find the file specified"
For example, it fails to find maven:
$ cmake -E chdir build32/bin/Debug/java mvn
The system cannot find the file specified
But without cmake, it works fine:
$ (cd build32/bin/Debug/java; mvn)
[INFO] Scanning for projects...
$ which mvn
/c/Maven/bin/mvn
However this seems to work:
$ cmake -E chdir build32/bin/Debug/dpe_java cmd /c mvn
[INFO] Scanning for projects...
The same behaviour happens with bash, cmd, and when building with msbuild:
C:\Users\elaurin>cmake -E chdir tmp mvn
The system cannot find the file specified
C:\Users\elaurin>cmake -E chdir tmp cmd /c mvn
[INFO] Scanning for projects...
C:\Users\elaurin>ver
Microsoft Windows [Version 10.0.16299.248]
C:\Users\elaurin>cmake --version
cmake version 3.10.1