# using Visual Studio 2022 Generator's install target

**URL:** https://discourse.cmake.org/t/using-visual-studio-2022-generators-install-target/8335
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [June 14, 2023, 8:53pm UTC](https://discourse.cmake.org/t/using-visual-studio-2022-generators-install-target/8335 "2023-06-14T20:53:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jrb](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/4da419/32.png) [@jrb](https://discourse.cmake.org/u/jrb)
#### Post date: [June 14, 2023, 8:53pm UTC](https://discourse.cmake.org/t/using-visual-studio-2022-generators-install-target/8335/1 "2023-06-14T20:53:18Z")

</div>

Hi,  
I just used the VS 2022 generator for the first time (3.26.4 and the vs bundled 3.64.0-msvc3) and I see the targets have a new layout when I open the solution. I have used cmake for many years. I see that I no longer get a filter called CMakeTargets with a project inside it called INSTALL like I used to but I do get a top-level project in my solution called install-distribution. What I can’t seem to figure out is how do I execute the install, I used to run the “build project” on INSTALL, running this on install-distribution does nothing. Running “build solution” just compiles and links all the targets without an install (as before).

On the command line **cmake --install** works as expected. I want to do this from inside the IDE like I always have.

I’ve looked in the docs page for the VS 2022 generator and it doesn’t mention any changes related to this [vs2022 generator](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html) Is there somewhere else to read about this?

I’ve tried using older generators with this latest version of cmake and it behaves as it always has: there is a project called INSTALL in the solution and running “build” on it runs the installation.

cheers,

- James

---

<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: [June 17, 2023, 10:53pm UTC](https://discourse.cmake.org/t/using-visual-studio-2022-generators-install-target/8335/2 "2023-06-17T22:53:09Z")

</div>

I see nothing in the CMake source code about `install-generator` or anything that would build up such a target name. Can you try using `--trace-expand` when configuring to see where this string might be coming from?

---

<div class="post-metadata">

### Author: ![jrb](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/4da419/32.png) [@jrb](https://discourse.cmake.org/u/jrb)
#### Post date: [June 18, 2023, 12:02am UTC](https://discourse.cmake.org/t/using-visual-studio-2022-generators-install-target/8335/3 "2023-06-18T00:02:39Z")

</div>

OK, this is very strange, I think this is pilot error, but I can’t say for sure.

I have installed a bunch of other things, seemingly not related to cmake and now when I use the “Visual Studio 17 2022” generator to try to get the --trace-expand log I get a filter called CMakePredefinedTargets and in there the normal INSTALL project I was expecting. I cannot reproduce the failure to generate this.

I think install-distribution is part of the CMakeLists.txt setup for the particular project I’m working with.

I cannot imagine I missed this filter before, I even showed the solution to a colleague, but stranger things have happened. I’ll close this and hopefully I’ll never see it again!

thanks and sorry for the noise

- James
