Getting ready

We will use the example from Recipe 1, Code reuse with functions and macros and keep the C++ sources unchanged and the file tree essentially the same:

.├── cmake│   └── testing.cmake├── CMakeLists.txt├── src│   ├── CMakeLists.txt│   ├── main.cpp│   ├── sum_integers.cpp│   └── sum_integers.hpp
└── tests    ├── catch.hpp    ├── CMakeLists.txt    └── test.cpp

Get CMake Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.