summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-05-13 18:13:00 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-05-13 18:13:00 (GMT)
commit27ab5339637d97a57a29252ff4bc15c21bce067b (patch)
treef1b5d62eab179d489b87744edda34c7609601b45
parent3744464c5e7599affb3ba3cc81e48ff9df7a0e49 (diff)
downloadCMake-27ab5339637d97a57a29252ff4bc15c21bce067b.zip
CMake-27ab5339637d97a57a29252ff4bc15c21bce067b.tar.gz
CMake-27ab5339637d97a57a29252ff4bc15c21bce067b.tar.bz2
BUG: minor cleanup and fix for convenience rules
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx43
1 files changed, 23 insertions, 20 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 78d36d2..4a0596c 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -509,26 +509,29 @@ cmGlobalUnixMakefileGenerator3
std::string makeTargetName;
depends.push_back("cmake_check_build_system");
- std::string dir = lg->GetMakefile()->GetStartOutputDirectory();
- dir = lg->Convert(dir.c_str(),cmLocalGenerator::HOME_OUTPUT,cmLocalGenerator::MAKEFILE);
- localName = dir;
- localName += "/directory";
-
- // write the directory rule
- commands.clear();
- makeTargetName = dir;
- makeTargetName += "/depend";
- commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
- makeTargetName = dir;
- makeTargetName += "/requires";
- commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
- makeTargetName = dir;
- makeTargetName += "/build";
- commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
-
- // Write the rule.
- lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
- localName.c_str(), depends, commands);
+ if (lg->GetParent())
+ {
+ std::string dir = lg->GetMakefile()->GetStartOutputDirectory();
+ dir = lg->Convert(dir.c_str(),cmLocalGenerator::HOME_OUTPUT,cmLocalGenerator::MAKEFILE);
+ localName = dir;
+ localName += "/directory";
+
+ // write the directory rule
+ commands.clear();
+ makeTargetName = dir;
+ makeTargetName += "/depend";
+ commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
+ makeTargetName = dir;
+ makeTargetName += "/requires";
+ commands.push_back(lg->GetRecursiveMakeCall("depend.make",makeTargetName.c_str()));
+ makeTargetName = dir;
+ makeTargetName += "/build";
+ commands.push_back(lg->GetRecursiveMakeCall("build.make",makeTargetName.c_str()));
+
+ // Write the rule.
+ lg->WriteMakeRule(ruleFileStream, "Convenience name for directory.",
+ localName.c_str(), depends, commands);
+ }
// for each target Generate the rule files for each target.
const cmTargets& targets = lg->GetMakefile()->GetTargets();