Putting CEDET ede-cpp-root-project commands outside the .emacs file

偶尔善良 提交于 2019-12-21 23:08:47

问题


I have a working EDE project, but I would like to locate the command in a file in the source tree for that project and not in my .emacs file. Is this possible?

I have tried using directory variables and emacs loads the file, but it does have any affect. To do this I placed the following code in .dir-locals.el in the project root:

((nil 
 . ((ede-cpp-root-project "MyProj"
     :name "MyProj Project"
     :file "/home/jlisee/projects/myproj_code/CMakeLists.txt"
     :include-path '( "/packages" )
     :system-include-path '( "/opt/myproj/local/include" )
     :spp-table '( ("CONST" . "const") )
     ))))

回答1:


The project type ede-cpp-root is for people who specifically want to keep the project file out of their source tree. If you want a project type in your source tree, there are other options.

If you are using a recent version of CEDET, you can instead enable the generic project types which in turn supports cmake (which it looks like you are using?)

(ede-enable-generic-projects)

Once in this generic project for CMake, use

 M-x ede-customize-project RET

to add in include paths, macro tables, and the like.

If you aren't using makefiles, cmake, or whatever, you can create your own generic project type with a bit of code in your .emacs file. Look in ede-generic for everything that mentions CMake, and it should be pretty obvious what 3 things to create.

I think the existing project type uses CMakeLists, not CMakeLists.txt, so perhaps the existing code needs a tweak.



来源:https://stackoverflow.com/questions/6693869/putting-cedet-ede-cpp-root-project-commands-outside-the-emacs-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!