diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-11-21 12:25:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-11-29 13:46:27 (GMT) |
commit | 9e3164dfa2747bd15c3d3e780875a9b286b765c6 (patch) | |
tree | 2b567572d36559c839609185ae7c059bb452d005 /Source | |
parent | 1528831bb1330cc539004f9fb3068e871f109d34 (diff) | |
download | CMake-9e3164dfa2747bd15c3d3e780875a9b286b765c6.zip CMake-9e3164dfa2747bd15c3d3e780875a9b286b765c6.tar.gz CMake-9e3164dfa2747bd15c3d3e780875a9b286b765c6.tar.bz2 |
VS: Add option to place `PACKAGE` target in solution default build
Add a `CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD` variable to control
this behavior.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index c60a1ff..602666e 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -681,20 +681,27 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild( // default build if another target depends on it int type = target->GetType(); if (type == cmStateEnums::GLOBAL_TARGET) { - // check if INSTALL target is part of default build - if (target->GetName() == "INSTALL") { - // inspect CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD properties - for (std::vector<std::string>::const_iterator i = configs.begin(); - i != configs.end(); ++i) { - const char* propertyValue = - target->Target->GetMakefile()->GetDefinition( - "CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD"); - cmGeneratorExpression ge; - CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = - ge.Parse(propertyValue); - if (cmSystemTools::IsOn( - cge->Evaluate(target->GetLocalGenerator(), *i))) { - activeConfigs.insert(*i); + std::list<std::string> targetNames; + targetNames.push_back("INSTALL"); + targetNames.push_back("PACKAGE"); + for (std::list<std::string>::const_iterator t = targetNames.begin(); + t != targetNames.end(); ++t) { + // check if target <*t> is part of default build + if (target->GetName() == *t) { + const std::string propertyName = + "CMAKE_VS_INCLUDE_" + *t + "_TO_DEFAULT_BUILD"; + // inspect CMAKE_VS_INCLUDE_<*t>_TO_DEFAULT_BUILD properties + for (std::vector<std::string>::const_iterator i = configs.begin(); + i != configs.end(); ++i) { + const char* propertyValue = + target->Target->GetMakefile()->GetDefinition(propertyName); + cmGeneratorExpression ge; + CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = + ge.Parse(propertyValue); + if (cmSystemTools::IsOn( + cge->Evaluate(target->GetLocalGenerator(), *i))) { + activeConfigs.insert(*i); + } } } } |