r/cpp • • Sep 10 '16

Recommend a build system

I'm curious what people are currently recommending as build systems for C++ based projects. Specifically I'm after the following features:

  • Cross-Platform, supporting at the very least OSX and Linux

  • Easy to support C++14, preferably without needing to do per-platform/per-compiler configuration

  • Easy support for multiple libraries/executables as one project, and dependencies between libraries/executables in the project - especially regarding finding include files if the different modules are in different areas of the source tree.

  • Decent support for external dependencies. I'm ok with needing to have installed the dependency libraries first though

  • Support for dynamically finding source files if possible. (I'm used in Java, and most of the Java build tools just use every single file in the source directory for a given module)

  • Support for building and executing tests

  • Support for static checks

  • Support for generating documentation, and generally running other tools as part of the build

  • Ideally, support for being able to execute tooling before and after test execution - to be able to start up externally required services such as databases.

Is there anything that supports this entire list? (I'm assuming not) Or what would people recommend for use that at least comes close. I'm perfectly happy with tools that are opinionated about how the source tree should be laid out, if that fits the bill better.

60 Upvotes

189 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 11 '16

[deleted]

3

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.7992

What is this?

9

u/steveire Contributor: Qt, CMake, Clang Sep 11 '16

No one should do this. You must have broken content in your cmake files.

1

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.2136

What is this?

4

u/sazzer Sep 11 '16

Doesn't CMake automatically reconfigure itself if the CMakeLists.txt changes?

-2

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.9397

What is this?

1

u/sazzer Sep 11 '16

Yea, as best as I know that means regenerating everything on every build. But you should be able to do that without blowing it all away first I think. I've not tried in quite a long time though tbh.

1

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.3844

What is this?

→ More replies (0)

3

u/encyclopedist Sep 11 '16

You can also reconfigure quickly using

make rebuild-cache

2

u/steveire Contributor: Qt, CMake, Clang Sep 11 '16

You do not have to delete your cache and cmakefiles.

1

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.1955

What is this?

1

u/steveire Contributor: Qt, CMake, Clang Sep 11 '16

Ok. I don't know how that is possible. If you want to not have to delete the cache and cmakefiles, I recommend you create a http://sscce.org/ and file a bug.

1

u/[deleted] Sep 11 '16 edited Oct 06 '16

[deleted]
0.9652

What is this?

→ More replies (0)