MiP
MiP

Reputation: 6442

Make Visual Studio's CMake tool run INSTALL when build solution

My VS2017 is using CMake 3.9.2 internally. I tried to build a C++ CMake project with Right click folder -> Open in Visual Studio -> Menu bar: CMake -> Build solution, unfortunately it didn't run INSTALL.

But when I used the default program CMake GUI to generate a visual studio solution, and then ran Build All. After building, it also ran the INSTALL project just fine.

I have set:

set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)

How could I make Visual Studio run INSTALL after building?

Upvotes: 1

Views: 1291

Answers (1)

vre
vre

Reputation: 6744

The INSTALL target of the Visual Studio solution depends by default on the ALL_BUILD target. So if you choose to "Set Startup Project" to INSTALL your solution will build and install.

Upvotes: 2

Related Questions