Discovering Scripts and Modules
Explore how to use CMake scripts and modules to automate complex build processes in C++ projects. Understand writing platform-agnostic scripts, utilizing built-in utility and find-modules, and managing external dependencies with find_package for efficient project builds.
We'll cover the following...
Work with CMake is primarily focused on projects that get built and the production of artifacts that get consumed by other systems, such as CI/CD pipelines and test platforms, or deployed to machines or artifact repositories. However, there are two other concepts of CMake that enable us to create with its language: scripts and modules.
Scripts
To configure project building, CMake offers a platform-agnostic programming language. This comes with many useful commands. We can use this tool to write scripts that come with our project or are completely independent.
Think of it as a consistent way to do cross-platform work: instead of using bash scripts on Linux and batch or PowerShell scripts on Windows, we can have one version. Sure, we could bring in external tools such as Python, Perl, or Ruby scripts, but this is yet another ...