summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-17 15:31:19 (GMT)
committerBrad King <brad.king@kitware.com>2010-12-17 15:31:19 (GMT)
commit9bcaff02ff066e9bdd69e3e1e3134aa65c53c121 (patch)
tree2f46b8a3e84e07b51b20c70065c8a1c26ad47fd5 /Source/cmGlobalGenerator.cxx
parent544d0c37742a068fa07b265380315a25af3ae9f3 (diff)
parent3d13502c986e43f070366d04891c8a3da05e2cb8 (diff)
downloadCMake-9bcaff02ff066e9bdd69e3e1e3134aa65c53c121.zip
CMake-9bcaff02ff066e9bdd69e3e1e3134aa65c53c121.tar.gz
CMake-9bcaff02ff066e9bdd69e3e1e3134aa65c53c121.tar.bz2
Merge branch 'cmake-guiRememberAdvancedCheckbox' into dev/strict-mode
Conflicts: Source/QtDialog/CMakeSetupDialog.cxx
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx72
1 files changed, 60 insertions, 12 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 201fceb..e4c169a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -863,19 +863,10 @@ void cmGlobalGenerator::Generate()
}
// Compute the inter-target dependencies.
- {
- cmComputeTargetDepends ctd(this);
- if(!ctd.Compute())
+ if(!this->ComputeTargetDepends())
{
return;
}
- std::vector<cmTarget*> const& targets = ctd.GetTargets();
- for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
- ti != targets.end(); ++ti)
- {
- ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
- }
- }
// Create a map from local generator to the complete set of targets
// it builds by default.
@@ -910,6 +901,23 @@ void cmGlobalGenerator::Generate()
}
//----------------------------------------------------------------------------
+bool cmGlobalGenerator::ComputeTargetDepends()
+{
+ cmComputeTargetDepends ctd(this);
+ if(!ctd.Compute())
+ {
+ return false;
+ }
+ std::vector<cmTarget*> const& targets = ctd.GetTargets();
+ for(std::vector<cmTarget*>::const_iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGlobalGenerator::CheckTargets()
{
// Make sure all targets can find their source files.
@@ -1489,7 +1497,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
// Add dependencies of the included target. An excluded
// target may still be included if it is a dependency of a
// non-excluded target.
- TargetDependSet & tgtdeps = this->GetTargetDirectDepends(target);
+ TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target);
for(TargetDependSet::const_iterator ti = tgtdeps.begin();
ti != tgtdeps.end(); ++ti)
{
@@ -1839,6 +1847,38 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
}
}
+//----------------------------------------------------------------------------
+const char* cmGlobalGenerator::GetPredefinedTargetsFolder()
+{
+ const char* prop =
+ this->GetCMakeInstance()->GetProperty("PREDEFINED_TARGETS_FOLDER");
+
+ if (prop)
+ {
+ return prop;
+ }
+
+ return "CMakePredefinedTargets";
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalGenerator::UseFolderProperty()
+{
+ const char* prop = this->GetCMakeInstance()->GetProperty("USE_FOLDERS");
+
+ // If this property is defined, let the setter turn this on or off...
+ //
+ if (prop)
+ {
+ return cmSystemTools::IsOn(prop);
+ }
+
+ // By default, this feature is ON:
+ //
+ return true;
+}
+
+//----------------------------------------------------------------------------
cmTarget cmGlobalGenerator::CreateGlobalTarget(
const char* name, const char* message,
const cmCustomCommandLines* commandLines,
@@ -1868,6 +1908,14 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
{
target.AddUtility(dit->c_str());
}
+
+ // Organize in the "predefined targets" folder:
+ //
+ if (this->UseFolderProperty())
+ {
+ target.SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
+ }
+
return target;
}
@@ -1881,7 +1929,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*,
}
//----------------------------------------------------------------------------
-cmGlobalGenerator::TargetDependSet &
+cmGlobalGenerator::TargetDependSet const&
cmGlobalGenerator::GetTargetDirectDepends(cmTarget & target)
{
return this->TargetDependencies[&target];