一个跨平台的build工具CMake

转载时请注明出处和作者联系方式:http://blog.csdn.net/mimepp
作者联系方式:YU TAO <yut616 at sohu dot com>

近来看到一个不错的building system工具CMake,可以实现跨平台操作,这里记录一下。

如果大家在大型的项目中使用过automake这样的building system的话,应该会感觉到使用它的痛苦,那东西太罗嗦了。
CMake是和automake类似的一个系统,但却有着它自己的诸多特点。

CMake的特性是能帮助你生成和某个平台有关的build files,如unix中的makefiles, MS VC中的workspaces/projects ,Mac OS 上的XCode的project files。从而使你的应用移植到其他平台时更快捷。
它还集成了一个测试系统CTest。
CMake已经应用在了KDE系统中,将原来的auto-tool的东西完全替换了。
号称kdelibs4的build时间比kdelibs3快了40%,而空间占用却只有automake的一成。

KDE的开发者使用后的感受:
The KDE 4 libraries (kdelibs) compile completely on all supported platforms, these are: Linux, *BSD, Mac OS X and MS Windows. The CMake build works both with GCC and with the MS compilers.
CMake itself doesn't do the actual building itself. The actual building is still done by the "make" utility or the respective native build tool on each platform. CMake reads script files, named CMakeLists.txt; the output it produces serves as input ("Makefiles" or e.g. project files for XCode) for the native build tool of each platform .

 CMake的开发者,在和KDE的开发者的合作中,写到:
"In the short time we have been working with the KDE developers in the migration to CMake, we have been impressed by the talents of the KDE developers and the quality of the source code. Building one of the world's largest open source projects has been an exciting challenge for CMake, and the result has benefited both projects. We feel that since CMake can build KDE on every supported platform, it can build anything !"

另一个特性就是可以使用CMake来实现很好的daily build,而且结果会非常直观,KDE开发者写到:
"make Experimental" or "make Nightly"
we can utilize the built-in support for continuous and/or nightly builds via Dart. This dashboard collects build results from all participating machines and platforms and displays them on a website.
Dart and the Dashboard will become a very useful tools to ensure that during development, KDE4 always compiles on all supported platforms (or that any build problem will be fixed in no time), and that the unit tests keep run successfully.
实例如:http://public.kitware.com/dashboard.php?name=kde

看样子,在你的下一个项目中,可以试验一下这个不错的CMake。

参考:
http://jserv.sayya.org/cmake/cmake-overview.pdf
http://lwn.net/Articles/188693/
http://www.cmake.org/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值