Database Doctor
Writing on databases, performance, and engineering.

Posts with tag: CMake

Cover

Modern CMake for C++ Projects

Today's blog is written in collaboration with my friend Martin Broholm Andersen.

Martin and I are both C++ programmers, but we come from different programming traditions. These differences provide us with a rich source of subjects to argue about. We both learn a lot from these arguments.

I've been working for years on old Cmake projects (from the 2.x era). Martin has been busy moving legacy .sln / .vcxproj projects at his workplace to modern, CMake 3.x style projects. His reasons for moving to CMake weren't to be able to cross compile or lock down binaries – but to scale, reorganize and merge the large code base he manages.

Martin is a Visual Studio user, I use CLion. We hope our mixed experience will give you a good experience no matter what tooling you prefer.

Martin's knowledge of modern CMake far exceeds mine. As he was melding his mind into mine, we both learned (and argued) a lot. This blog contains the result of our discussions, and our final agreement on best practices for creating modern style repos that use Cmake 3.x.

We expect that this blog will be updated and expanded to serve as a reference for both experienced developers and new users who're just getting started with Cmake and C++.

The repo containing our template CMake project can be found on GitHub:

  • Modern Cmake.

As is the tradition on Database Doctor – I encourage disagreement and discussions.

Read More...