开发者

Build management in C++ & good IDEs on Linux

I am starting to write a moderately sized project in C++ requiring a fairly large amount of files and dependencies on other projects.

Do you think manually maintaining a Makefile for this project is the best approach?

Are there other better alternative开发者_开发问答s for C++ that make build management and dependency management of files really easy to handle?

Also, what IDE is good for C++ development on Linux? I am comfortable with Vim, but do you think there are good IDEs for C++ (like Eclipse for Java) that provide code-completion etc?

Thanks! Ajay


Others have already recommended using CMake. To my mind you should manage your project with CMake then decide on your favourite IDE.

CMake allows you to describe the project to be built, instead of how to build it. For example: I want to create a shared library called foo with source files a.cpp, b.cpp and c.h and it requires these link dependencies. Then on unix you get libfoo.so and on windows you get foo.dll and foo.lib. All common project settings can be abstracted up to higher levels in the build tree, this keeps most files very simple. More complicated requirments can be refactored into macros.

Once your project is described like this CMake will generate makefiles and/or IDE projects. This means each developer can choose their own IDE, as well as allowing you to mandate an IDE if appropriate.

My company use CMake to build the c++ in our product on windows and solaris. It contains 600 projects and 1.5 million lines of source code. We originally chose it as a cross platform build utility when porting to solaris, however for a large project like ours it is much easier to manage the build with CMake than with Visual Studio project files. I would recommend it as a build utility for any c++ project of any size

We use the eclipse cdt on solaris and are very happy with it. Most of our development is with visual studio on windows. cmake also works well with other ides I use it with KDeveloper4 on linux at home without a hitch.


KDevelop4 (from subversion or rc1 from their site) + CMake makes life so much easier, automake should just die. If you want a cross-platform solution, netbeans + the c++ plugin are pretty decent, not as good as kdevelop4 though.


I like CMake a lot for the whole building process (but I have almost no experience with scons or Jam).

I use vim or qtcreator. Qtcreator is still in developpment, but very promising I think.


I suggest you Code::Blocks. I use it on Debian and works gracefully.

http://www.codeblocks.org/

Edit: Added another link http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks


Eclipse does C++ as well - through eclipse CDT - not as comprehensive as Java but pretty good.


Manually maintaining Makefiles in larger Projects becomes quite painful. If you start using automake/autoconf, you will - after a while of learning all the facets - appreciate the powerful possibilities these tools can offer.

And as IDE simply use Emacs. It's quick, powerful and supports Code completion etc.


There's also Code::Blocks as an IDE with its own building system. But I would encourage you to try out other build tools (CMake, Boost.Build, SCons) if you want to be able to build your software "anywhere" without having a fancy schmancy IDE installed. ;-)


I found Emacs + Scons works pretty well for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜