开发者

make emacs cedet semantic look for include directories

Cedet is a nice tool suite but in default configuration it has some difficulty locating included files.

I would like to make it look for a directory called include/ in each parent directory and get the file from there.

for exa开发者_StackOverflowmplme a file /home/fakedrake/my-project/some-thing/something-else/file.c has #include "file.h" file.h is in some-thing/file.h but cedet fails to locate it

What would be awesome would be to make cedet look for file.h to create completions in directories

/home/fakedrake/my-project/some-thing/include/
/home/fakedrake/my-project/include/

( and i could live with it if it tried to look for

/include/
/home/include/
/home/fakedrake/include/ 

)


You can use EDE for it. Moreover, it allows you to specify different include paths for particular projects. EDE is a part of Cedet, so you needn't install anything.

The basic setup is:

(global-ede-mode t)

Then for each project you should have something like that:

(if (file-exists-p "~/dev/chanconf/Makefile")
    (ede-cpp-root-project "chanconf"
                          :name "Channel Config"
                          :file "~/dev/chanconf/Makefile"
                          :system-include-path '("/usr/include"
                                                 "/usr/include/boost")
                          :include-path '("/src"
                                          "/test/gtest/include")
                          :spp-table '(("BOOST_PROGRAM_OPTIONS_DECL" . ""))))

It's not exactly what you're asking for since you still have to list all the include directories. But usually it's done only one time per project and doesn't require too much effort, so I hope it helps.

An article on Cedet by Alex Ott is a pretty good source of ideas if you need more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜