From 5540e1c255d6e600aad1c4489281f35c45f90cc0 Mon Sep 17 00:00:00 2001
From: Robert Goulet <robert.goulet@autodesk.com>
Date: Fri, 1 May 2015 13:46:17 -0400
Subject: [PATCH] Add new CMAKE_INCLUDE_INSTALL_TO_DEFAULT_BUILD variable.

---
 Source/cmGlobalVisualStudio7Generator.cxx | 17 +++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index de90f7e..65433d3 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -1031,6 +1031,21 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
   int type = target->GetType();
   if (type == cmTarget::GLOBAL_TARGET)
     {
+    // check if INSTALL target is part of default build
+    if(target->GetName() == "INSTALL")
+      {
+      // inspect CMAKE_INCLUDE_INSTALL_TO_DEFAULT_BUILD[_<CONFIG>] properties
+      for(std::vector<std::string>::iterator i = this->Configurations.begin();
+          i != this->Configurations.end(); ++i)
+        {
+        const char* propertyValue =
+          target->GetMakefile()->GetDefinition("CMAKE_INCLUDE_INSTALL_TO_DEFAULT_BUILD");
+        cmGeneratorExpression ge;
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(propertyValue);
+        if(cmSystemTools::IsOn(cge->Evaluate(target->GetMakefile(), *i)))
+          {
+          activeConfigs.insert(*i);
+          }
+        }
+      }
     return activeConfigs;
     }
   if(type == cmTarget::UTILITY && !this->IsDependedOn(projectTargets, target))
-- 
1.9.4.msysgit.0

