Error looks like this: CMake Error at foo/CMakeLists.txt:435 (ADD_LIBRARY): Cannot find source file: mysourcefile.cpp (...) Clicking on line number 1 does not open the corresponding CMakeLists.txt file. Reproducible: Always
Someone just needs to add the proper filter to kdevplatform/outputview/outputfilteringstrategies.cpp or let it be supplied by the cmake plugin.
@Morten: Could you please elaborate what CompilerFilterStrategy::errorInLine is supposed to do? I'm especially puzzled about this part of that method's body: if( curErrFilter.compiler == "cmake" ) { // Unfortunately we cannot know if an error or an action comes first in cmake, and therefore we need to do this if( d->m_currentDirs.empty() ) { d->putDirAtEnd( d->m_buildDir.upUrl().toLocalFile() ); } } item.url = d->urlForFile( regEx.cap( curErrFilter.fileGroup ) ); What is upUrl() doing in there? Are you assuming that the build folder always resides in the source directory? Could you have a look please?
Hi Kevin First, I must apologise for not replying before now ( still haven't been able to replace my broken PC ). Looking at it I think your point is valid. The source dir is not necessarily the parent dir of the build dir. But frankly I'm a little uncertain about what to do about it - since the source dir could, in theory, be located anywhere. Any suggestions are welcome. Regards Morten fredag den 19. juli 2013 skrev Kevin Funk : > https://bugs.kde.org/show_bug.cgi?id=321982 > > --- Comment #2 from Kevin Funk <kevin@kfunk.org <javascript:;>> --- > @Morten: Could you please elaborate what > CompilerFilterStrategy::errorInLine is > supposed to do? > > I'm especially puzzled about this part of that method's body: > > if( curErrFilter.compiler == "cmake" ) { // Unfortunately > we > cannot know if an error or an action comes first in cmake, and therefore we > need to do this > if( d->m_currentDirs.empty() ) { > d->putDirAtEnd( > d->m_buildDir.upUrl().toLocalFile() ); > } > } > item.url = d->urlForFile( regEx.cap( > curErrFilter.fileGroup ) > ); > > What is upUrl() doing in there? Are you assuming that the build folder > always > resides in the source directory? Could you have a look please? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Patch progress/discussion: https://git.reviewboard.kde.org/r/115506/
*** Bug 360854 has been marked as a duplicate of this bug. ***
*** Bug 342800 has been marked as a duplicate of this bug. ***
*** Bug 376571 has been marked as a duplicate of this bug. ***
I had a look at this issue and the solution proposed before. I think the easiest and least invasive way to fix this is to just filter the project directory out of the cmake output. The code change is minimal and just a couple of lines long. I also tried to cover Windows paths in the regex, but I don't have a system to test this properly. For my patch proposal see: https://phabricator.kde.org/D7040
Differential https://phabricator.kde.org/D7040 has been submitted to master branch
So we consider this fixed? Closing then. Please reopen if it's not fixed.