diff options
author | Brad King <brad.king@kitware.com> | 2006-09-28 20:40:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-09-28 20:40:35 (GMT) |
commit | 9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a (patch) | |
tree | 62bbc9236a49a4f235b010bd433745a7a7870f68 /Source/cmMakefileTargetGenerator.cxx | |
parent | 7d2de52c1a617a8a559e5c749ce5e6abd3739f01 (diff) | |
download | CMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.zip CMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.tar.gz CMake-9a1d4e92eb6347dbe6d03cc861e284f6a4da5a6a.tar.bz2 |
BUG: Fix/cleanup custom commands and custom targets. Make empty comment strings work. Fix ZERO_CHECK target always out of date for debugging. Fix Makefile driving of custom commands in a custom target. Fix dependencies on custom targets not in ALL in VS generators.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cd8239c..cc16069 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -35,6 +35,7 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator() this->BuildFileStream = 0; this->InfoFileStream = 0; this->FlagFileStream = 0; + this->DriveCustomCommandsOnDepends = false; } cmMakefileTargetGenerator * @@ -775,6 +776,23 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() commands.push_back(depCmd.str()); // Make sure all custom command outputs in this target are built. + if(this->DriveCustomCommandsOnDepends) + { + this->DriveCustomCommands(depends); + } + + // Write the rule. + this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, + depMark.c_str(), + depends, commands, false); +} + +//---------------------------------------------------------------------------- +void +cmMakefileTargetGenerator +::DriveCustomCommands(std::vector<std::string>& depends) +{ + // Depend on all custom command outputs. const std::vector<cmSourceFile*>& sources = this->Target->GetSourceFiles(); for(std::vector<cmSourceFile*>::const_iterator source = sources.begin(); @@ -790,11 +808,6 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() } } } - - // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0, - depMark.c_str(), - depends, commands, false); } //---------------------------------------------------------------------------- @@ -1040,6 +1053,12 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output, { // Setup the comment for the main build driver. comment = "Rule to build all files generated by this target."; + + // Make sure all custom command outputs in this target are built. + if(!this->DriveCustomCommandsOnDepends) + { + this->DriveCustomCommands(depends); + } } // Write the driver rule. |