# cmake --build show exact command executed

**URL:** https://discourse.cmake.org/t/cmake-build-show-exact-command-executed/7408
**Category:** Usage
**Created:** [February 5, 2023, 3:36pm UTC](https://discourse.cmake.org/t/cmake-build-show-exact-command-executed/7408 "2023-02-05T15:36:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ignus2](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ignus2/32/3075_2.png) [@ignus2](https://discourse.cmake.org/u/ignus2)
#### Post date: [February 5, 2023, 3:36pm UTC](https://discourse.cmake.org/t/cmake-build-show-exact-command-executed/7408/1 "2023-02-05T15:36:47Z")

</div>

I use VS generator. How can I see the **exact** command line cmake --build issues when it invokes msbuild.exe to build the project? Even if I use the -v (verbose) flag, it only displays msbuild output, but not how msbuild was invoked exactly.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 8, 2023, 4:52pm UTC](https://discourse.cmake.org/t/cmake-build-show-exact-command-executed/7408/2 "2023-02-08T16:52:26Z")

</div>

It looks like CMake gathers it, but throws it away in the `cmake --build` codepath. Looking at the code, it’s something like `<msbuild> <project>.sln /build <config> /project <target> <options…>`. I think using a CTest script and `ctest_build` would show the output though with enough verbosity.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 8, 2023, 7:33pm UTC](https://discourse.cmake.org/t/cmake-build-show-exact-command-executed/7408/3 "2023-02-08T19:33:06Z")

</div>

[https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/8183](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8183)
