mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 03:48:02 +08:00
CMP0082: Check EXCLUDE_FROM_ALL property at generate time
Fixes: #22234
This commit is contained in:
@@ -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<std::string>(), "", MessageDefault,
|
||||
excludeFromAll, std::move(backtrace))
|
||||
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) {
|
||||
|
@@ -21,7 +21,6 @@ class cmInstallSubdirectoryGenerator : public cmInstallGenerator
|
||||
public:
|
||||
cmInstallSubdirectoryGenerator(cmMakefile* makefile,
|
||||
std::string binaryDirectory,
|
||||
bool excludeFromAll,
|
||||
cmListFileBacktrace backtrace);
|
||||
~cmInstallSubdirectoryGenerator() override;
|
||||
|
||||
|
@@ -1844,7 +1844,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
||||
}
|
||||
|
||||
this->AddInstallGenerator(cm::make_unique<cmInstallSubdirectoryGenerator>(
|
||||
subMf, binPath, excludeFromAll, this->GetBacktrace()));
|
||||
subMf, binPath, this->GetBacktrace()));
|
||||
}
|
||||
|
||||
const std::string& cmMakefile::GetCurrentSourceDirectory() const
|
||||
|
@@ -1 +1,2 @@
|
||||
install(CODE "message(STATUS \"exclude\")")
|
||||
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||
|
@@ -1,3 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
|
@@ -1,3 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
|
@@ -1,3 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
|
Reference in New Issue
Block a user