Просмотр исходного кода

include_external_msproject: Restore support for EXCLUDE_FROM_ALL

In commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to targets,
2019-01-15, v3.14.0-rc1~83^2) all `AddNewTarget` call sites were updated
to copy the directory-level `EXCLUDE_FROM_ALL` into the target property
of the same name, except that the one for `include_external_msproject`
was incorrectly missed.  Add it now.

Furthermore, refactoring in commit b99129d2d8 (ENH: some code cleanup,
2007-03-12, v2.6.0~2020) accidentally set the `EXCLUDE_FROM_ALL` target
property of `include_external_msproject`-generated targets to `FALSE`
instead of simply leaving it unset.  This was not necessary but had no
effect until the above commit gave it a meaning.  Drop that.

Fixes: #18986
Brad King 7 лет назад
Родитель
Сommit
3106cf4e3d
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      Source/cmIncludeExternalMSProjectCommand.cxx

+ 3 - 1
Source/cmIncludeExternalMSProjectCommand.cxx

@@ -85,10 +85,12 @@ bool cmIncludeExternalMSProjectCommand::InitialPass(
     // Create a target instance for this utility.
     cmTarget* target = this->Makefile->AddNewTarget(cmStateEnums::UTILITY,
                                                     utility_name.c_str());
+    if (this->Makefile->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+      target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
+    }
 
     target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());
     target->SetProperty("EXTERNAL_MSPROJECT", path.c_str());
-    target->SetProperty("EXCLUDE_FROM_ALL", "FALSE");
 
     if (!customType.empty())
       target->SetProperty("VS_PROJECT_TYPE", customType.c_str());