diff options
author | Alexander Neundorf <neundorf@kde.org> | 2009-09-16 18:01:23 -0400 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2009-09-16 18:01:23 -0400 |
commit | 298de4374b99a98dd336620d6d049c725e48faf8 (patch) | |
tree | 2234e26d10b89df1af80d5ce8df9b45f99c1381a /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 229b67a2499586a9aaf54d3d5a88fee7a3f37e2c (diff) | |
download | cmake-298de4374b99a98dd336620d6d049c725e48faf8.tar.gz |
Major improvement of the generated targets in Eclipse.
Before this change all targets were displayed in the top level directory of
the project. Now the targets are displayed in the correct directory.
The targets "clean" and "all" are now created in every subdirectory.
Also now the targets for just compiling one file, preprocessing one file,
assembling one file are are created for Eclipse.
Additionally all targets get a prefix now in eclipse, so that they are
sorted in a way which makes sense (global targets first, then executable and
libraries, then object files, then preprocessed, then assembly). Also
this prefix gives the user a hint what the target is, i.e. whether it's a
library or an executable or something else.
Alex
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 2c365ed43d..eb77284b9f 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -152,6 +152,30 @@ void cmLocalUnixMakefileGenerator3::Generate() } //---------------------------------------------------------------------------- +void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets + (std::vector<std::string>& targets) +{ + for (std::map<cmStdString, LocalObjectInfo>::iterator lo = + this->LocalObjectFiles.begin(); + lo != this->LocalObjectFiles.end(); ++lo) + { + targets.push_back(lo->first); + + std::string::size_type dot_pos = lo->first.rfind("."); + std::string base = lo->first.substr(0, dot_pos); + if(lo->second.HasPreprocessRule) + { + targets.push_back(base + ".i"); + } + + if(lo->second.HasAssembleRule) + { + targets.push_back(base + ".s"); + } + } +} + +//---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() { // generate the includes @@ -228,12 +252,14 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() this->WriteObjectConvenienceRule( ruleFileStream, "target to preprocess a source file", (base + ".i").c_str(), lo->second); + lo->second.HasPreprocessRule = true; } if(do_assembly_rules) { this->WriteObjectConvenienceRule( ruleFileStream, "target to generate assembly for a file", (base + ".s").c_str(), lo->second); + lo->second.HasAssembleRule = true; } } } |