Bug 186163 - no way to specify custom include paths for custom makefile project
Summary: no way to specify custom include paths for custom makefile project
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Custom Makefiles (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-04 23:09 UTC by Vadym Krevs
Modified: 2012-01-18 01:36 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Custom makefile project screenshot from kdevelop3 (52.50 KB, image/png)
2009-03-05 17:03 UTC, Vadym Krevs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadym Krevs 2009-03-04 23:09:07 UTC
Version:           3.9.91 (using 4.2.1 (KDE 4.2.1) "release 108", KDE:KDE4:Factory:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.27.19-3.2-default

I've create a custom makefile project from a folder containing C++ source code. When I open any source file, the "Problems" tab is filled with "Included file not found: <filename.h>" messages and many #include directives are underscored with red. The source code in question is cross-platform and vpaths are used in the makefile to resolve location of platform-specific header.

This was not an issue for Kdevelop3 due to the a ability to specify custom include paths in project configuration. Please add support for this feature - or at least provide a way to disable red underscoring.
Comment 1 Andreas Pakulat 2009-03-05 08:58:49 UTC
not going to happen anytime soon as we don't have anybody that wants to work on custom makefile support right now.
Comment 2 Vadym Krevs 2009-03-05 09:19:06 UTC
Does any other project type (currently) supported by kdevelop4 support custom include paths?
Comment 3 Vadym Krevs 2009-03-05 09:25:44 UTC
Just rechecked in Kdevelop3 - custom include paths are not a custom makefile project-specific option. It was a normal project option under "Project->Project Options->C++ support->Code Completion". I assume you still have someone willing to work on C++ code completion support? :-)
Comment 4 Andreas Pakulat 2009-03-05 09:31:10 UTC
The system changes drastically in KDevelop4. C++ support expects the buildsystem to provide the right include paths. Even more so as we don't have any "completion databases" anymore.

The only well-maintained buildsystem in KDevelop4 currently is CMake and that one supplies the needed include paths from the CMakeLists.txt files.
Comment 5 Vadym Krevs 2009-03-05 14:51:25 UTC
Sadly, that makes the currently available KDevelop4 fairly useless for anyone with a non-CMake based build. I have always thought the custom makefile project support in kdevelop3 was a killer feature not available in other IDEs.
Comment 6 David Nolden 2009-03-05 14:59:02 UTC
@Andreas please remember: There is the include-path resolver, and it can resolve include-paths from makefiles. I'm tired of having to correct you every single time this subject comes up.

@Vadym Krevs:
There is a tool within KDevelop that can resovle the include-paths from custom makefiles by doing a call to "make". This works in many cases, but in some it doesn't. If you have built kdevelop4, you can test it on the command-line with the binary "kdev_includepathresolver". It currently fails if the source-files are in a subfolder of their actual Makefile.

Apart from that, we're planning to implement a generic way of setting custom include-paths. It's not high priority for me personally, but the kdev4 user "Thorben Kröger" told me that he wanted to work on it soon.
Comment 7 Andreas Pakulat 2009-03-05 15:07:43 UTC
Kdevelop3 had no "custom makefile" support, it had "custom buildsystem" support. Which might not come back at all.

The problem is that we simply lack the manpower to work on more than having good Qt4/KDE4/CMake support at the moment.
Comment 8 Andreas Pakulat 2009-03-05 16:50:24 UTC
(In reply to comment #6)
> @Andreas please remember: There is the include-path resolver, and it can
> resolve include-paths from makefiles. I'm tired of having to correct you every
> single time this subject comes up.

I'm well aware of that hack, but as you know yourself its nothing more and there apparently also exist enough "corner cases" in which it doesn't work.
Comment 9 Vadym Krevs 2009-03-05 17:03:38 UTC
Created attachment 31801 [details]
Custom makefile project screenshot from kdevelop3

Hmm, then what is this selected thingy?
Comment 10 David Nolden 2009-03-05 17:20:00 UTC
@Andreas: Yes but it's not that many corner-cases. Actually only one I know of. Already now it works with automake-projects, cmake-projects, unsermake-projects, and simple custom makefile projects. Once that subdirectory-thing is fixed, this should cover 90% of all makefile projects. For the rest, we can allow the users to specify custom include paths.
Comment 11 David Nolden 2009-03-05 17:23:55 UTC
@Vadym: Well, what do you expect from "custom makefile support"?

KDevelop4 will allow you to use a project with custom makefiles, and will allow having code-completion on it. In worst case you will have to specific the include paths by yourself.

The only thing it won't offer is GUI management features for a custom makefile project.
Comment 12 Andreas Pakulat 2009-03-05 17:42:02 UTC
(In reply to comment #9)
> Created an attachment (id=31801) [details]
> Custom makefile project screenshot from kdevelop3
> 
> Hmm, then what is this selected thingy?

You didn't understand me. The so-called "custom makefile" support in KDevelop3 actually supported any kind of buildsystem (I'm using that here with a totally custom, in-house buildsystem). And the KDevelop3 custom makefile-support didn't support specifying custom include paths at all, that was part of the C++ support in KDevelop3.
Comment 13 Andreas Pakulat 2009-03-05 17:43:23 UTC
(In reply to comment #10)
> @Andreas: Yes but it's not that many corner-cases. Actually only one I know of.
> Already now it works with automake-projects, cmake-projects,
> unsermake-projects, and simple custom makefile projects. Once that
> subdirectory-thing is fixed, this should cover 90% of all makefile projects.
> For the rest, we can allow the users to specify custom include paths.

What about out-of-source builds? Unless I'm mistaken it even can't support that without some additional support from the buildsystem.
Comment 14 Andreas Pakulat 2009-03-05 17:48:08 UTC
Oh, btw, just to have this written down somewhere: The problem is not so much adding a GUI to specify a list of include dirs for a given project. The problem is that this only works for the simpler projects. In real world apps you'll want to have this list on at least a per-build-folder basis, possibly even on a per-compiled-file basis. Else you'd easily confuse the C++ parser, if you have headers with the same name from two include-dirs included in two different cpp files.

So implementing this properly is not quite easy unfortunately, apart from needing support for specifying a builddir first.
Comment 15 Vadym Krevs 2009-03-05 18:04:05 UTC
I hear what you're saying, gents. IMHO, ability to specify a list of include dirs for a given project would be a good step in the right direction. If this is difficult to do, then at least provide a way to turn off red underscoring of unresolved #include's, etc.

@David Nolden, comment #11: Parity with Kdevelop3 would make me very happy - ability to specify and build my own makefile, customizable make environments in order to be able to do debug/release build, popup-based word completion and ctags-based symbol lookup, ability to click on an error/warning in build output and be transferred to the right line in the affected file.
Comment 16 David Nolden 2009-03-05 18:09:49 UTC
@Andreas comment #13: It does support out of source builds. Of course it needs to know the build directory for that, else there is no way, because that contains the Makefiles.
Comment 17 David Nolden 2009-03-06 01:06:39 UTC
I've taken the time to make the include path resolver work with source files in
sub-directories.
Also it's now possible to specify custom include paths: Just create a
".kdev_include_path" file in the source directory that contains the paths.

Now we just need to allow setting a build-directory for custom makefile projects.
Comment 18 David Nolden 2009-03-06 01:13:59 UTC
Sorry I miswrote the filename. It should be ".kdev_include_paths".
Comment 19 Vadym Krevs 2009-03-06 09:01:24 UTC
What's the syntax for contents of .kdev_include_files? Each include path on separate line?
Comment 20 Andreas Pakulat 2009-03-06 09:49:02 UTC
this bug is not fixed, we have a workaround which is nice. But at some point we need a real fix. Re-opening.
Comment 21 David Nolden 2009-03-06 10:06:55 UTC
@Vadym: Yes, but look exactly at the filename
Comment 22 nlovell 2010-07-23 21:18:39 UTC
There seems also to be a UI screen that pops up if the path resolver couldn't locate it -- however that seems to be the only way to get to that screen.
Comment 23 Nicolás Alvarez 2010-12-06 04:50:40 UTC
Given comment 22, isn't this fixed?
Comment 24 Aleix Pol 2012-01-18 01:36:08 UTC
I consider it fixed, maybe it can be improved but now you're able to add include directories.