The code for this recipe is available at https://github.com/dev-cafe/cmake-cookbook/tree/v1.0/chapter-14/recipe-01, and includes a C++ example. The Recipe is valid with CMake version 3.5 (and higher) and has been tested on GNU/Linux, macOS, and Windows.
In this recipe, we will extend the test example of Recipe 1, Creating a simple unit test, from Chapter 4, Creating and Running Tests, and deploy the test result to https://my.cdash.org/index.php?project=cmake-cookbook, which we created for this book on the public dashboard (https://my.cdash.org) provided to the community by Kitware.