On Wed, Jul 24, 2013 at 11:29 AM, Stephen Kelly <steve...@gmail.com> wrote:
> Nicolas Desprès wrote: > > >> + UpdateOutputToSourceMap(outputs, file); > >> > >> is missing a 'this->', as per the style. There's a couple of repeats of > >> that. > >> > > Done > > You seem to have missed this one. > > There are also other style issues. > > * Don't put an else after a return > * Wrap single line blocks in {} > > Done. I hope I did them all. > > > That's said we can optimize further as I mentioned in my comment ( > > > > https://github.com/nicolasdespres/CMake/commit/59c871da8b00554812e93ba9c6e47d864424efb0#L0R2023 > ). > > Do you have an opinion about it? > > Do I understand correctly that the issue is that OutputToSource values can > be absolute or relative paths? That would be fixable by patching only > UpdateOutputToSourceMap, right? > Not exactly. According to my tests only cmMakefiles::GetSourceFileWithOutput's cname argument can be either relative or absolute. When the mapping table is updated it always get an absolute path. The previous code of GetSourceFileWithOutput() supported both relative and absolute paths. Here my test setup: diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b68460d..d035e25 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1029,6 +1029,10 @@ void cmMakefile::UpdateOutputToSourceMap(const std::string& output, cmSourceFile* source) { + std::cout << "UPDATE: " << source->GetFullPath() + << " -> " + << output + << std::endl; this->OutputToSource[output] = source; } @@ -2051,6 +2055,7 @@ cmMakefile::Compare::operator()(const std::string& s1, cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname) { std::string name = cname; + std::cout << "QUERY: " << name << std::endl; OutputToSourceMap::iterator o = this->OutputToSource.find(name); if (o != this->OutputToSource.end()) { Now when I run either: ctest -VV -R ExportImport | tee /tmp/ImportExport-master.log or ctest -VV -R '^CustomCommand$' | tee /tmp/CustomCommand-master.log I get some relative path in the QUERY debug message. That's reason why I wrote the Compare functor because those tests were failing after my first patch. I hope it is clearer now. Cheers, -Nico
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers