Summary
In this chapter, we have learned how to structure a CMake project to support reusability. We have learned how to implement the CMake utility modules, how to share them, and how to use utility modules written by others. Having the ability to leverage CMake modules enables us to better organize our projects and better collaborate with our team members in unison. CMake projects will be much easier to maintain with this knowledge on hand. The common, reusable code between CMake projects will grow into an extensive collection of useful modules that makes writing projects with CMake easier.
I want to remind you that CMake is a scripting language and should be treated as such. Use software design principles and patterns to make CMake code more maintainable. Organize your CMake code into functions and modules. Reuse and share the CMake code as much as possible. Please do not neglect your build system code, or you may have to write it from scratch.
In the next chapter, we will...