如何在C ++构建工作流程中集成PreMake / CMake [英] How to integrate PreMake/CMake in a C++ build workflow

查看:488
本文介绍了如何在C ++构建工作流程中集成PreMake / CMake的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在在看PreMake / CMake。但是,我不知道如何在整个跨平台构建工作流程中使用它。实际上,它生成makefile(或解决方案)。那么,你如何在每个目标平台上实际构建这些解决方案?你必须为每个目标维护一个构建脚本(如.sh或.bat文件)?这将破坏使用像preake / CMake这样的工具的目的。

I am looking at PreMake/CMake for the moment. However, I fail to see how this could be used in an entire cross-platform build workflow. Indeed, it generates makefiles (or solutions). Then, how do you actually build those solutions on each targeted platforms? Do you have to maintain one build script per target (like .sh or .bat file)? This would defeat the purpose of using a tool like premake/CMake in the first place.

指向教程的链接,显示从编码到最终构建产品的所有过程

A link to a tutorial showing all the process from coding to final built product using premake would be great.

感谢您的帮助。

推荐答案

主要的开发也是在C ++中完成的。我们使用CMake + ANT。 Windows上的VisualStudio,Mac和iOS上的XCode。一些构建工具是用Python编写的。

Our main development is also done in C++. We use CMake + ANT. VisualStudio on Windows, XCode for Mac and iOS. Some build tools are written in Python.

它工作得很顺利。我们有单元和低级组件测试从构建直接运行(利用CMake的CTest机制,我们稍微修改 - CMake是开源)。更高级别的组件和系统测试通过C#编写的定制框架运行(我们有一个伟大的争论是使用现成的东西还是写我们自己的,最终我们决定任何现成的框架我们得修改这么多,这是值得的,从头开始写我们自己;我仍然想知道是否是正确的决定)。

It works rather smoothly. We have unit and low-level component tests run straight from the build (utilizing CMake's CTest mechanism which we tinkered with slightly - CMake is Open Source). Higher level component and system tests are run via a custom-made framework written in C# (we had a great debate whether to use something off-the-shelf or write our own, in the end we decided that any off-the-shelf framework we get would have to be modified so much that it was worth it to write our own from scratch; I'm still wondering if it was the right decision).

我们将事情与ANT结合在一起 - 主要使用< exec>呼叫在最低级别,但也利用成熟的扩展(例如 ftp svn )。我们的CI运行在Jenkins上,通过ANT绑定到较低的构建层。

We tie things together with ANT - mostly using <exec> calls at the lowest level, but also utilizing well-established extensions (such as ftp and svn). Our CI runs on Jenkins that ties up into the lower build layers via ANT.

这篇关于如何在C ++构建工作流程中集成PreMake / CMake的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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