Domanda

I want to use cedet to navigate in my program. I use semantic-ia-fast-jump to jump to the declaration, and semantic-analyze-proto-impl-toggle to jump to implementation. I found this two command need the files in the same dirctory. So I need to add all of the directories to the search path. I refer to a guy from the internet. the code like as follow:

(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))        

I have several modules , so I need to add many directories. It's not converient and not portable. I think it must be a good way to config this.

PS: refer to http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html#sec6
My setting like following

    (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" . "")))

semantic-ia-fast-jump can work well, but the semantic-analyze-proto-impl-toggle can't work . It seems that the head and source files must in the same directories. how to solve this problem.

È stato utile?

Soluzione

It's better to setup projects (look to my article on CEDET, for example). And inside the project, you can refer to relative paths using include-path directive

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top