diff --git a/Source/cmInstallSubdirectoryGenerator.cxx b/Source/cmInstallSubdirectoryGenerator.cxx index 0fcfa546fe..794694ea31 100644 --- a/Source/cmInstallSubdirectoryGenerator.cxx +++ b/Source/cmInstallSubdirectoryGenerator.cxx @@ -14,10 +14,10 @@ #include "cmSystemTools.h" cmInstallSubdirectoryGenerator::cmInstallSubdirectoryGenerator( - cmMakefile* makefile, std::string binaryDirectory, bool excludeFromAll, + cmMakefile* makefile, std::string binaryDirectory, cmListFileBacktrace backtrace) : cmInstallGenerator("", std::vector(), "", MessageDefault, - excludeFromAll, false, std::move(backtrace)) + false, false, std::move(backtrace)) , Makefile(makefile) , BinaryDirectory(std::move(binaryDirectory)) { @@ -52,7 +52,7 @@ bool cmInstallSubdirectoryGenerator::Compute(cmLocalGenerator* lg) void cmInstallSubdirectoryGenerator::GenerateScript(std::ostream& os) { - if (!this->ExcludeFromAll) { + if (!this->Makefile->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { cmPolicies::PolicyStatus status = this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0082); switch (status) { diff --git a/Source/cmInstallSubdirectoryGenerator.h b/Source/cmInstallSubdirectoryGenerator.h index 614cef9214..f174d07c4a 100644 --- a/Source/cmInstallSubdirectoryGenerator.h +++ b/Source/cmInstallSubdirectoryGenerator.h @@ -21,7 +21,6 @@ class cmInstallSubdirectoryGenerator : public cmInstallGenerator public: cmInstallSubdirectoryGenerator(cmMakefile* makefile, std::string binaryDirectory, - bool excludeFromAll, cmListFileBacktrace backtrace); ~cmInstallSubdirectoryGenerator() override; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4ffd47bec6..675ff1d8d3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1844,7 +1844,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath, } this->AddInstallGenerator(cm::make_unique( - subMf, binPath, excludeFromAll, this->GetBacktrace())); + subMf, binPath, this->GetBacktrace())); } const std::string& cmMakefile::GetCurrentSourceDirectory() const diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt index 1bd7f495bf..32bb1a96b6 100644 --- a/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt +++ b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt @@ -1 +1,2 @@ install(CODE "message(STATUS \"exclude\")") +set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake index 56c1b81f79..8ebf21b3d6 100644 --- a/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake @@ -1,3 +1,3 @@ add_subdirectory(CMP0082) -add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +add_subdirectory(CMP0082-ExcludeFromAll) install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake index 56c1b81f79..8ebf21b3d6 100644 --- a/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake @@ -1,3 +1,3 @@ add_subdirectory(CMP0082) -add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +add_subdirectory(CMP0082-ExcludeFromAll) install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake index 56c1b81f79..8ebf21b3d6 100644 --- a/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake @@ -1,3 +1,3 @@ add_subdirectory(CMP0082) -add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +add_subdirectory(CMP0082-ExcludeFromAll) install(CODE "message(STATUS \"top\")")