便携式C ++构建系统 [英] Portable C++ build system

查看:101
本文介绍了便携式C ++构建系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个好的和容易的维护便携式构建系统的C ++项目。主要平台应包括Windows(Visual Studio 8+)和Linux(gcc); Cygwin可能是一个优势。我们正在考虑两种主要的可能性: CMake Boost.Jam 。 SCons也可以是一个选项,但我还没有调查它。 CMake和Boost.Jam似乎有以下特点:

I'm looking for a good and easy in maintenance portable build system for C++ projects. Main platforms should include Windows (Visual Studio 8+) and Linux (gcc); Cygwin may be an advantage. We're considering two main possibilities: CMake and Boost.Jam. SCons can be also an option, but I haven't investigated it yet. CMake and Boost.Jam seem to have the following traits:

CMake:


  • (+)生成原生makefile(Windows解决方案,Eclipse项目)

  • (+)测试和打包扩展

  • < )需要在每个项目文件夹
  • ( - )中的配置文件

  • (+) generates native "makefile" (solution for Windows, project for Eclipse)
  • (+) extensions for testing and packaging
  • (-) demands a configuration file in every project folder
  • (-) based on a little too verbose peculiar language

Boost.Jam:

Boost.Jam:


  • 自行构建,无中间步骤

  • (+)不会生成原生解决方案/项目

  • )对多线程和静态/动态库等属性的直观支持

什么是其他可能性,什么构建系统可以创建解决方案?

What are other possibilities and what is really preferable after experience? What build systems can create a solution on the way?

推荐答案


( - )需要一个配置文件在每个项目文件夹

(-) demands a configuration file in every project folder

这不正确,你只需要传递更多的pathes:

This is not correct, you just need to pass bigger pathes like:

add_program(foo src/foo.cpp src/main.cpp)

很少注释,关于Boost.Jam - 首先它不是Boost.Jam - bjam自己相当无用,你要找的是Boost.Build它是一组Jam宏,使bjam有用。

Few notes, about Boost.Jam - first it is not Boost.Jam - bjam on its own quite useless, what you are looking for is Boost.Build which is set of Jam macros that make bjam useful.

现在,我和两人一起工作,我必须承认,Boost.Build不适合Boost本身以外的任何严重项目。需要找图书馆?不能找到标题?不能。需要做简单的生成之外的事情 - 你不知道如何做它作为BB文档...完全无用,也许覆盖10%的BB。因此,大多数情况下,你需要提出问题在BB邮件列表和...

Now, I worked with both, and I must admit, Boost.Build is not suitable for any serious projects outside the Boost itself. Need to find library? Can't need to find header? Can't. Need to do something outside of simple build - and you have not idea how to do it as BB documentation... Totally useless and maybe cover 10% of BB. So most of cases you need to ask questions in BB mailing lists and...

所以,如果你有一些复杂的项目 - 你需要做一些更简单编译和链接,远离Boost.Build。

So, if you have some complicated project - and you need to make something more then simple compile and link, stay away from Boost.Build.

所以如果你需要支持MSVC,我发现今天CMake只是可行的选择。

So if you need to support MSVC I find today CMake as only feasible choice.

我不知道CMake是非常好的系统,它有很多问题,但它是东西
主要适合跨平台开发(如果你需要支持MSVC)。

I don't tell that CMake is very good system, it has many problems but it is something mostly suitable for cross platform development (if you need to support MSVC).

如果你不关心MSVC并且对MinGW感到满意...也要看看autotools。

And if you don't care about MSVC and happy with MinGW... take a look on autotools as well.

关于Scons - 它仍然不成熟他们CMake。

About Scons - it is still less mature them CMake.

这篇关于便携式C ++构建系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆