简体   繁体   English

如何将PreMake / CMake集成到C ++构建工作流中

[英]How to integrate PreMake/CMake in a C++ build workflow

I am looking at PreMake/CMake for the moment. 我目前正在看PreMake / CMake。 However, I fail to see how this could be used in an entire cross-platform build workflow. 但是,我看不到如何在整个跨平台构建工作流程中使用它。 Indeed, it generates makefiles (or solutions). 实际上,它会生成makefile(或解决方案)。 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)? 您是否必须为每个目标维护一个构建脚本(例如.sh或.bat文件)? This would defeat the purpose of using a tool like premake/CMake in the first place. 首先,这会破坏使用诸如premake / CMake之类的工具的目的。

A link to a tutorial showing all the process from coding to final built product using premake would be great. 一个链接到教程,该教程显示了使用premake从编码到最终制造产品的所有过程。

Thanks for any help. 谢谢你的帮助。

Our main development is also done in C++. 我们的主要开发也是用C ++完成的。 We use CMake + ANT. 我们使用CMake + ANT。 VisualStudio on Windows, XCode for Mac and iOS. Windows上的VisualStudio,Mac和iOS上的XCode。 Some build tools are written in Python. 一些构建工具是用Python编写的。

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). 我们直接从构建中运行单元和低级组件测试(利用我们稍加修改的CMake的CTest机制-CMake是开源的)。 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). 较高级别的组件和系统测试是通过用C#编写的定制框架运行的(我们进行了激烈的辩论,究竟是使用现成的东西还是编写自己的东西,最后我们决定使用任何现成的框架我们将不得不做很多修改,以至于从头开始编写我们自己的是值得的;我仍然想知道这是否是正确的决定)。

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 ). 我们将内容与ANT结合在一起-大多在最低级别使用<exec>调用,但同时也利用完善的扩展名(例如ftpsvn )。 Our CI runs on Jenkins that ties up into the lower build layers via ANT. 我们的CI在Jenkins上运行,并通过ANT绑定到较低的构建层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM