Getting ready

The source code is unchanged with respect to the previous recipe and the structure of the project is as follows:

.├── cmake│   └── messageConfig.cmake.in├── CMakeLists.txt├── src│   ├── CMakeLists.txt│   ├── hello-world.cpp│   ├── Message.cpp│   └── Message.hpp└── tests    ├── CMakeLists.txt    └── use_target        ├── CMakeLists.txt        └── use_message.cpp

Notice that we have added a cmake subdirectory containing a messageConfig.cmake.in file. This file will contain our exported targets. We have also added a test to check whether the installation and export of the project work as intended.

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.