Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

C++ Build tool?

 
Santiago Bravo
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Im using MS C++ to make builds of my C++ code. Is there a tool like maven or ant that can be used with C++ code?

I would eventually like to have this building automatically into a continious integration tool


Thanks

S.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make files are pretty common for C++. What do you want your build tool to do that make does not?

As far as continuous integration, I came across an article by Martin Fowler about cruise control and c++
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18166
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant can be used to do C++ builds, but make is much more common (and older). On the Microsoft platform, you may find it named "nmake" or "nmk" and the exact characteristics of the makefile have been known to change significantly between Visual Studio releases.

Which is why I finally threw up my hands in despair at doing things in Windows/MS C++. There are few things I like less than having to do an emergency one-line fix to software only to discover that it won't compile anymore because the API libraries were replaced by something completely different and the makefile is the wrong format.
 
Santiago Bravo
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use VC++ 6 to build my apps. What im looking for is something that will let me automatically build on a unix/linux machine, which i can then use with a CI tool like Bamboo


Will make be sufficient? I tried cmake on Windows but came across many issues.

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Plain old GNU make is awesome; I still use it for Java on several projects. Beats the pants off Ant, frankly, if you only need to build on UNIX. If you need to build on Windows, you can use cygwin, and then using make takes only a small amount of additional effort. Either way it's still loads easier and more flexible than Ant. Seriously.

CMake is, like Ant, an attempt to improve on make that IMO isn't as good as the original. But make honestly doesn't need improving (unless you really, truly insist that your developers have to work on Windows.)
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18166
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The biggest issue when cross-compiling is to first make sure that the code is compatible. If you you're using the Microsoft Frustration Classes or other Windows-specific include files and libraries, you're in for trouble. If you wrote for vanilla Unix/ANSI C/C++ you should be pretty much OK. There are some portable UI packages that allow you to write GUI code that can be made to run on both Windows and Linux.

The CMake files generated by Visual Studio are basically dumps of the Visual Studio compiler environment. As I recall, they can be rather muddy compared to creating a makefile from scratch.

Unlike Ernest, my enthusiasm for Make versus Ant is a little more tempered. I'd been using make heavily for a LONG time before I discovered Ant, but once I made friends with Ant, I gave up using Make for Java builds. Ant is easier to work with on Java projects, and the builds are easy to make OS-independent. Make is a little less abstract on some things, and as a result, it requires a little more work to make makefiles OS-independent. Also, since Ant's core tasks are Java-savvy, they make it easier to deal with some of the complex directory structures that you get in Java. However, Ant is more cumbersome than Make for C code.
 
Agador Paloi
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check the documentation for your compiler. If it provides a command line method of compiling and linking
you can use Ant to do your build.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic