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

天涯浪子 提交于 2019-12-06 03:42:45

问题


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.

Thanks for any help.


回答1:


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.

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).

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.



来源:https://stackoverflow.com/questions/9529284/how-to-integrate-premake-cmake-in-a-c-build-workflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!