//---------------------------------------------------------------------------- void cmMakefileTargetGenerator ::WriteObjectBuildFile(std::string &obj, const char *lang, cmSourceFile& source, std::vector& depends) { this->LocalGenerator->AppendRuleDepend(depends, this->FlagFileNameFull.c_str()); this->LocalGenerator->AppendRuleDepends(depends, this->FlagFileDepends[lang]); // generate the depend scanning rule this->WriteObjectDependRules(source, depends); std::string relativeObj = this->LocalGenerator->GetHomeRelativeOutputPath(); relativeObj += obj; // Write the build rule. // Build the set of compiler flags. std::string flags; // Add language-specific flags. std::string langFlags = "$("; langFlags += lang; langFlags += "_FLAGS)"; this->LocalGenerator->AppendFlags(flags, langFlags.c_str()); // Add target-specific flags. if(this->Target->GetProperty("COMPILE_FLAGS")) { std::string langIncludeExpr = "CMAKE_"; langIncludeExpr += lang; langIncludeExpr += "_FLAG_REGEX"; const char* regex = this->Makefile-> GetDefinition(langIncludeExpr.c_str()); if(regex) { cmsys::RegularExpression r(regex); std::vector args; cmSystemTools::ParseWindowsCommandLine( this->Target->GetProperty("COMPILE_FLAGS"), args); for(std::vector::iterator i = args.begin(); i != args.end(); ++i) { if(r.find(i->c_str())) { this->LocalGenerator->AppendFlags (flags, i->c_str()); } } } else