Emacs 通过cedet进行导航时的路径配置
我想使用cedet在我的程序中导航。我使用semantic ia fast jump跳转到声明,使用semantic analyze proto impl toggle跳转到实现。我发现这两个命令需要相同目录中的文件。因此,我需要将所有目录添加到搜索路径。我指的是互联网上的一个人。代码如下所示:Emacs 通过cedet进行导航时的路径配置,emacs,cedet,Emacs,Cedet,我想使用cedet在我的程序中导航。我使用semantic ia fast jump跳转到声明,使用semantic analyze proto impl toggle跳转到实现。我发现这两个命令需要相同目录中的文件。因此,我需要将所有目录添加到搜索路径。我指的是互联网上的一个人。代码如下所示: (setq semanticdb-project-roots (list (expand-file-name "~/"))) (defconst cedet-user-include-dirs
(setq semanticdb-project-roots (list (expand-file-name "~/")))
(defconst cedet-user-include-dirs
(list "~/samuel/project/modules/MManage/inc"
"~/samuel/project/modules/MManage/src"
...
))
(require 'semantic-c nil 'noerror)
(let ((include-dirs cedet-user-include-dirs))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
include-dirs))
我有几个模块,所以我需要添加许多目录。它不方便携带。我认为这一定是一个很好的配置方式
备注:请参阅我的设置如下
(ede-cpp-root-project "library_samuel"
:name "library_samuel project"
:file (expand-file-name "~/samuel/project_self/library_samuel/CMakeLists.txt")
:include-path '("/common/include" "/modules/MManage/inc" "/modules/ImageProcess/inc" )
:spp-table '(("BUILD_APP" . "")))
语义ia快速跳转可以很好地工作,但语义分析原型执行切换无法工作。看来头文件和源文件必须在同一个目录中。如何解决这个问题。最好设置项目(例如,查看)。在项目内部,您可以使用
include path
指令参考相对路径谢谢Alex Ott,我以前读过您的文章。在那个时候,我不理解“如何定制语义与C&C++项目一起工作”。我以为它是属于EDE的。我只需要语义部分。再次感谢亚历克斯·奥特。我已经设置了“ede cpp根项目”,就像你现在说的那样,跳转到声明是没有问题的。但它不能在定义中使用“语义分析原型执行切换”。我发现只有头文件和源文件在同一个目录中。这是我的设置:(ede cpp根项目“library\u samuel”:name“library\u samuel project”:file(扩展文件名“~/samuel/project\u self/library\u samuel/CMakeLists.txt”):include path'(“/common/include”“/modules/MManage/inc”“/modules/ImageProcess/inc”))嗯,我还没有查看原型转换源代码,但它应该在位置上独立工作,我需要对此进行调查Alex,非常感谢你的指导,我终于掌握了语义分析的基础知识。