将 CEDET ede-cpp-root-project 命令放在 .emacs 文件之外
我有一个正在运行的 EDE 项目,但我想在该项目的源代码树中的文件中找到该命令,而不是在我的 .emacs 文件中。这可能吗?
我尝试过使用 目录变量 并 emacs 加载文件,但它确实有任何影响。为此,我将以下代码放置在项目根目录的 .dir-locals.el 中:
((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") )
))))
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") )
))))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
项目类型 ede-cpp-root 适合那些特别希望将项目文件保留在源代码树之外的人。如果您想要源树中的项目类型,还有其他选项。
如果您使用的是最新版本的 CEDET,则可以启用通用项目类型,该类型又支持 cmake(看起来您正在使用它?)
一旦进入此 CMake 通用项目,请使用
添加包含路径、宏表,等等。
如果您不使用 makefile、cmake 或其他文件,则可以使用 .emacs 文件中的一些代码创建自己的通用项目类型。在 ede-generic 中查找所有提到 CMake 的内容,应该很明显要创建什么 3 个东西。
我认为现有的项目类型使用 CMakeLists,而不是 CMakeLists.txt,因此现有代码可能需要调整。
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?)
Once in this generic project for CMake, use
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.