How to create an EDE project for C++

前端 未结 2 2096
长情又很酷
长情又很酷 2021-02-09 06:35

I have been trying to set up an EDE project for C++ (emacs24 + builtin CEDET) and I\'m starting to get desperate because I can\'t seem to find the way I want the makefiles to be

2条回答
  •  悲&欢浪女
    2021-02-09 07:00

    EDE is designed to handle many different kinds of projects, usually of a type where the build system was written outside of Emacs in some other tool.

    The EDE project type that creates Makefiles for you can do quite a few things, but you need to have some basic understanding of build systems for it to be helpful, and you really do need to customize the projects to get anything of any complexity working.

    I've recently added a section to the EDE manual to help with basic project setups that autogenerate Automake files. You can check out the tutorial here:

    http://www.randomsample.de/cedetdocs/ede/ede/Quick-Start.html

    The same steps will apply for projects that just use Make instead, but Make based projects often have trouble with shared libraries due to the extra complexity.

    Mike's answer is quite good, but I think it is ok to just add .h files to the same target as your .cpp sources. It will keep track of them separately.

    Another useful trick is to use the whole project compile keystroke (C-c . C) which uses a capital C whenever you change something big. That will regenerate the Makefiles, rerun any needed Automake features, and start at the top.

    EDIT: You only need one EDE project for a give project area. The ede-cpp-root project is useful when no other automatic project type works. That's when you create that in your .emacs file so that the other tools that need a project definition, like semantic's smart completion, and tag lookup, will work.

提交回复
热议问题