How it works
We have used find_package to detect the unit_test_framework component of Boost (see Chapter 3, Detecting External Libraries and Programs, Recipe 8, Detecting the Boost libraries). We have insisted that this component is REQUIRED, and the configuration will stop if it cannot be found in the system environment. The cpp_test target needs to know where to find Boost header files, and needs to be linked against the corresponding libraries; these are both provided by the IMPORTED library target, Boost::unit_test_framework, set by a successful call to find_package. We recall from the discussion in Recipe 3, Building and linking static and shared libraries, in Chapter 1, From a Simple Executable to Libraries that IMPORTED libraries are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access