11

How could I see the commands issued when I run "cmake --build . --target INSTALL" command? There doesn't seem to be an option like --versbose or something. The cmake help says that "cmake --build" is an interface to the underlying build tool, but doesn't say anything about the dump of commands issued.

The reason I need this is because, when I try to run msbuild on commandline, it fails with an error saying the target INSTALL doesn't exist in the project. However, cmake succeeds. So, I guess, cmake also might be using msbuild itself, albeit with some specific options.

bbv
  • 501
  • 1
  • 5
  • 14

2 Answers2

13

You can pass additional options to the native build tool with the -- switch, i.e.:

cmake --build . --target INSTALL -- /verbosity:detailed
sakra
  • 62,199
  • 16
  • 168
  • 151
  • Actually, I would like to see the commandline issued by cmake e.g. "msbuild product.sln /t:ALL_BUILD". I am not interested in finding what msbuild is doing in this case. So, the verbosity is required for cmake itself. – bbv Jan 17 '14 at 04:02
  • 2
    `cmake --build ... -- -clp:ShowCommandLine` (see MSBuild [command-line reference](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2019)). – Roman Shevchenko Jun 09 '21 at 20:56
2

you can found the solution at:

https://cmake.org/Wiki/CMake_FAQ

On Windows (nmake) you can override CMAKE_VERBOSE_MAKEFILE by using nmake /S If you actually want to see what the command looks like, set CMAKE_START_TEMP_FILE and CMAKE_END_TEMP_FILE to "" -- be warned, however, you cannot set these as variables on the CMake command line with -D. Instead, see the very bottom of the file "Modules/Platform/Windows.cmake" and uncomment the lines that set these variables to the empty string.

Atheel Massalha
  • 424
  • 1
  • 6
  • 18