From d70204a86aa3e454e73049efda3e1ccea8c60720 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 20 Jan 2013 12:50:53 +0100 Subject: [PATCH] Only output includes once after the start of 'generate-time' when debugging. During configure-time, GetIncludeDirectories may be called too, for example if using the export() command. As the content can be different, it should be output each time then. --- Source/cmGlobalGenerator.cxx | 1 + Source/cmMakefile.cxx | 1 + Source/cmMakefile.h | 6 ++++++ Source/cmTarget.cxx | 9 ++++++++- Source/cmTarget.h | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d2baf535c..f28bd6c39 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -980,6 +980,7 @@ void cmGlobalGenerator::Generate() // Generate project files for (i = 0; i < this->LocalGenerators.size(); ++i) { + this->LocalGenerators[i]->GetMakefile()->SetGeneratingBuildSystem(); this->SetCurrentLocalGenerator(this->LocalGenerators[i]); this->LocalGenerators[i]->Generate(); this->LocalGenerators[i]->GenerateInstallRules(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7e7766407..4721e4c03 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -99,6 +99,7 @@ cmMakefile::cmMakefile(): Internal(new Internals) this->AddDefaultDefinitions(); this->Initialize(); this->PreOrder = false; + this->GeneratingBuildSystem = false; } cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index bb161b16c..a2783f296 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -870,6 +870,9 @@ public: return this->IncludeDirectoriesEntries; } + bool IsGeneratingBuildSystem(){ return this->GeneratingBuildSystem; } + void SetGeneratingBuildSystem(){ this->GeneratingBuildSystem = true; } + protected: // add link libraries and directories to the target void AddGlobalLinkInformation(const char* name, cmTarget& target); @@ -1019,6 +1022,9 @@ private: // Enforce rules about CMakeLists.txt files. void EnforceDirectoryLevelRules(); + + bool GeneratingBuildSystem; + }; //---------------------------------------------------------------------------- diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 815da408c..fb99b4a3f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -151,6 +151,7 @@ cmTarget::cmTarget() this->IsApple = false; this->IsImportedTarget = false; this->BuildInterfaceIncludesAppended = false; + this->DebugIncludesDone = false; } //---------------------------------------------------------------------------- @@ -2739,11 +2740,17 @@ std::vector cmTarget::GetIncludeDirectories(const char *config) cmSystemTools::ExpandListArgument(debugProp, debugProperties); } - bool debugIncludes = std::find(debugProperties.begin(), + bool debugIncludes = !this->DebugIncludesDone + && std::find(debugProperties.begin(), debugProperties.end(), "INCLUDE_DIRECTORIES") != debugProperties.end(); + if (this->Makefile->IsGeneratingBuildSystem()) + { + this->DebugIncludesDone = true; + } + for (std::vector::const_iterator it = this->Internal->IncludeDirectoriesEntries.begin(), end = this->Internal->IncludeDirectoriesEntries.end(); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 69a00c14c..47ec528d3 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -610,6 +610,7 @@ private: bool DLLPlatform; bool IsApple; bool IsImportedTarget; + bool DebugIncludesDone; mutable std::map > LinkDependentProperties; mutable std::set LinkImplicitNullProperties;