5

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.

Korchkidu
  • 4,908
  • 8
  • 49
  • 69
  • I'm not sure I understand the question. Premake generates build files. You build them by *building them*. If you generated a makefile, you run `make` on it. If you generated a VC `.sln`, then you run VC on it. The point of Premake is that your *users* can use whatever build files they are comfortable with. You can use VC projs, while your users can use makefiles or Code::Blocks or whatever. – Nicol Bolas Mar 04 '12 at 20:38
  • premake (or CMake) generate project files (or makefiles). The question is to know how to build those files in a platform independent way. Ant seems to just do that... – Korchkidu Mar 04 '12 at 22:17

1 Answers1

5

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.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • Thanks. I am programming in C++. I edited the question. Also, I need the entire workflow. I heard that we must close the Visual Studio solution, then launch premake, then reopen the solution... That's why I want to hear about people using premake and how they use it daily. – Korchkidu Mar 04 '12 at 12:44
  • 1
    Our main development is also done in C++. We use CMake + ANT (mainly). VisualStudio on Windows, XCode for Mac and iOS. It works rather smoothly. I think a 'tutorial' is a bit too much to ask - you'll get more mileage from asking specific questions. – malenkiy_scot Mar 04 '12 at 13:58
  • How do you integrate CMake + Ant? Do you use something like this:http://code.google.com/p/cmakeant/ ? – Korchkidu Mar 04 '12 at 18:26
  • 1
    Loosely speaking the answer is 'yes' - we've developed an ANT 'library' of various CMake calls. Strictly speaking the answer is 'no' - we call CMake via , not through an extension. – malenkiy_scot Mar 04 '12 at 18:45
  • Great. Please put those details in your answer and I will accept it. Thanks! – Korchkidu Mar 04 '12 at 19:52
  • Why would you use cmake and ant together? Don't they both fill the same role? – Joseph Garvin Apr 29 '12 at 15:44
  • 2
    @JosephGarvin, The short answer is "not at all" :) – malenkiy_scot Apr 29 '12 at 18:11