-
Book Overview & Buying
-
Table Of Contents
Minimal CMake
By :
If you’ve made it this far, give yourself a well-deserved pat on the back – you’ve come a long way! In this chapter, we discussed how to make a library compatible with FetchContent. This involved reviewing the project’s physical structure, how to create a library, and how to use generator expressions to control include interfaces. Then, we looked at how to make use of our new library. With that in place, we extracted our Game of Life logic to a separate library with a new interface. We looked in depth at how to make it a shared library and the many concerns to account for across Windows, macOS, and Linux, as well as how CMake can help us (in terms of export headers, custom commands for DLL copying on Windows, and customizing target properties to help with relocatable libraries on macOS and Linux). We wrapped up by making some minor improvements to help avoid cross-platform issues and looking at interface (or header-only) libraries and how to create...