There are many projects which define important macros on the compiler's command line. KDevelop needs to provide a way for the user to specify these macros so that the parsed code makes sense. Sometimes one can work around the problem by manually defining those macros in a header file that is included by every file in the project (if there is such a file). That is inconvenient though (you'll have to be careful not to commit those defines to the repository, and you'll have to unapply/apply again when moving to a different branch). Besides, sometimes luck is not on your side and there is no such fortuitous file. I am currently struggling with a project like that. The only way I can think of overcoming this problem is to manually add an "#include kdev-macros.h" to every file in the project, which I'd rather not do. Implementing the feature in bug 315705 would provide a workaround while this feature is not implemented. This is point 1 in bug 324260. Reproducible: Always
Since the implementation of bug #315705, we may have a temporary work-around. By adding a header file that contains the macros we need defined we can now have that included auto-included. I haven't seen the patch that adds a GUI interface to manipulate this parentJob()->masterJob()->indexedIncludePaths() mentioned in the patch (https://projects.kde.org/projects/extragear/kdevelop/kdevelop/repository/revisions/236dbb9eea46f2f1e297dbd443e05fe7288b073b/diff), but I'm presuming it exists. This doesn't completely resolve this issue, because there are other problems it may still not solve or leave very cumbersome, but it's a nice step forward.
Git commit 75170596d827cc150752b59b473e7046d1010dcf by Sergey Kalinichev. Committed on 21/03/2014 at 13:58. Pushed by skalinichev into branch 'master'. Break Custom Buildsystem Plugin apart into 2 pieces. Features: *Now it's possible to define macros and add include directories/files through GUI. *The GUI is always accessible by clicking on Project->Open Configuration. Note that there is no relation between this plugin and .kdev_include_paths. That is include directories from .kdev_include_paths are not accessible from Custom defines and includes plugin and vice versa. In future .kdev_include_paths file will be used only for out-of-project files. Known shortcomings: *After includes/defines modification, the project must be reloaded manually to apply the changes. *Include files assistant stores data in .kdev_include_paths, but it should in .kdev4 file for in-project files. *It's difficult to add many include directories at a time. *... Don't forget to run kbuildsycoca4. Related: bug 254662 REVIEW: 115696 http://commits.kde.org/kdevelop/75170596d827cc150752b59b473e7046d1010dcf