File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes C++ Build tool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "C++ Build tool?" Watch "C++ Build tool?" New topic
Author

C++ Build tool?

Santiago Bravo
Ranch Hand

Joined: Jul 25, 2008
Posts: 226
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.


Santiago
My Path to SCJP Certification My Path to SCWCD Certification
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30910
    
158

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++


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Santiago Bravo
Ranch Hand

Joined: Jul 25, 2008
Posts: 226
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

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


[Jess in Action][AskingGoodQuestions]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

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

Joined: Jan 24, 2006
Posts: 118
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: C++ Build tool?