Reputation: 21514
I have a Visual Studio 2015 solution generated by CMake. CMake created a "INSTALL" project that copies all the files I requested (using Cmake's install command in my CMakeLists.txt files).
This "INSTALL" project is skipped when I request a full solution build
I tried to add set_target_properties(INSTALL PROPERTIES EXCLUDE_FROM_ALL FALSE)
but this reports set_target_properties Can not find target to add properties to: INSTALL
.
How can I make "INSTALL" be generated by default? I'd like the checkbox surrounded in red in screenshot below to be enabled automatically:
Upvotes: 4
Views: 8902
Reputation: 61
Moreover, the variable can be added as an option on cmake launch from command line. For VS 2017:
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD=ON ..
Upvotes: 2
Reputation: 4195
After some checking, it seems that there is a single common function that sets which projects are part of default build.
cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild
Here is the part that does the check:
const std::string propertyName =
"CMAKE_VS_INCLUDE_" + *t + "_TO_DEFAULT_BUILD";
// inspect CMAKE_VS_INCLUDE_<*t>_TO_DEFAULT_BUILD properties
So as was mentioned in Florian's answer, you should be able to use CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
as well any custom project using
set(CMAKE_VS_INCLUDE_<custom project name>_TO_DEFAULT_BUILD 1)
Upvotes: 2
Reputation: 42912
You can use CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
:
set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
Upvotes: 13