Avoiding Copies And Moves With auto
When C++11 introduced auto, it opened up a whole range of useful techniques and improved the life of C++ developers in a variety of ways. There’s no shortage of simple examples and tutorials teaching...
View ArticleTest Fixtures With CMake/CTest
New test properties were added in CMake 3.7.0 to support test fixtures. Put simply, a fixture allows setup and cleanup tasks to be associated with a group of tests. On their own, fixtures are quite...
View ArticleGenerated Sources In CMake Builds
Using a set of source files to build libraries and executables is about the most basic thing a build system needs to do. This is relatively easy with CMake, but things get more interesting when some...
View ArticleDo Not Redefine CMake Commands
In this article, we take a closer look at a particular example from the popular Effective CMake talk by Dan Pfeifer. The example in question relies on undocumented behavior, the dangers of which may...
View ArticleForwarding Command Arguments In CMake
The previous article discussed an example from Dan Pfeifer’s popular Effective CMake talk. That article highlighted the dangers of trying to override a function and forward the call to the original...
View ArticleCMake And C++ Consulting Services Now Available
Following the successful launch of my book Professional CMake: A Practical Guide last year and receiving positive feedback from readers, I’m pleased to announce that I’ve formed my own consulting...
View ArticleCppCon 2019: Deep CMake For Library Authors
This talk presents a road map for C++ library authors grappling with cross-platform aspects of library development and deployment. It highlights key CMake features that every cross-platform library...
View ArticleQuoting In CMake
Let’s be honest, CMake’s syntax is not one of its most popular characteristics. This article isn’t going to try to convince you otherwise. Rather, it focuses on how quoting in CMake works. Its goal is...
View ArticleBuild Performance Insights
From time to time, people ask me whether it is possible to gain insight into the build performance of a C++ project. Using a tool like Ninja to efficiently build in parallel is usually an easy first...
View ArticleC++20 Modules, CMake, And Shared Libraries
CMake 3.28 was the first version to officially support C++20 modules. Tutorials and examples understandably tend to focus on the fairly simple scenario of building a basic executable, perhaps also...
View Article