Getting ready

In this recipe, we will reuse the sources from Chapter 3, Detecting External Libraries and Programs, Recipe 4, Detecting the BLAS and LAPACK math libraries. Although we will not modify the actual implementation sources or header files, we will modify the project tree structure following the recommendations discussed in Chapter 7, Structuring Projects, and arrive at the following source code structure:

.├── CMakeLists.txt├── README.md└── src    ├── CMakeLists.txt    ├── linear-algebra.cpp    └── math        ├── CMakeLists.txt        ├── CxxBLAS.cpp        ├── CxxBLAS.hpp        ├── CxxLAPACK.cpp        └── CxxLAPACK.hpp

Here we have collected all the wrappers to BLAS and LAPACK, which provide the math library under src/math. The main program is linear-algebra.cpp. All ...

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.