diff options
author | Brad King <brad.king@kitware.com> | 2016-11-29 13:59:11 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-11-29 13:59:11 (GMT) |
commit | 839cd16396eec521f0112e4f542fcf347d029620 (patch) | |
tree | 87b8c8f75f8957973657fab99782b6f6d3a133c9 /Source | |
parent | 2f7bafd6dacbe83b881866c0c7a00847ef266382 (diff) | |
parent | 9e3164dfa2747bd15c3d3e780875a9b286b765c6 (diff) | |
download | CMake-839cd16396eec521f0112e4f542fcf347d029620.zip CMake-839cd16396eec521f0112e4f542fcf347d029620.tar.gz CMake-839cd16396eec521f0112e4f542fcf347d029620.tar.bz2 |
Merge topic 'vs-default-build-package'
9e3164df VS: Add option to place `PACKAGE` target in solution default build
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); + } } } } |