cmake --build: add a way to see generated native build command
I use:
- CMake 3.7.0-rc2
- Git for Windows 2.10.1
- Visual Studio 2015 Update 3
- Windows 7
I try to add /maxcpucount
switch for multi-processor compilation.
The following commands work fine (when invoked from native Windows console):
cmake --build . --config Debug --target INSTALL
cmake --build . --config Debug --target INSTALL -- /maxcpucount:4
cmake --build . --config Debug --target INSTALL -- /maxcpucount
cmake --build . --config Debug --target INSTALL -- /m:4
cmake --build . --config Debug --target INSTALL -- /m
The following commands work fine (when invoked from Git for Windows console):
cmake --build . --config Debug --target INSTALL
cmake --build . --config Debug --target INSTALL -- /maxcpucount:4
The following commands do not work (when invoked from Git for Windows console):
cmake --build . --config Debug --target INSTALL -- /maxcpucount
cmake --build . --config Debug --target INSTALL -- /m:4
cmake --build . --config Debug --target INSTALL -- /m
outputs for them respectively:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: C:/Program Files/Git/maxcpucount
For switch syntax, type "MSBuild /help"
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: m:4
For switch syntax, type "MSBuild /help"
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: M:/
For switch syntax, type "MSBuild /help"
I tried to figure out what is going on by adding --trace-expand
and --debug-output
switches but they didn't help me to investigate. For example:
$ cmake --trace-expand --debug-output --build . --config Debug --target INSTALL -- /maxcpucount
Running with expanded trace output on.
Running with debug output on.
CMake Error: The source directory "C:/Program Files/Git/maxcpucount" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Can you please fix one of those trace options to show full command line received by CMake and full command line passed to MSBuild?
Thanks!