Digression: pkg-config, CMake, and Other Development Files
Explore the roles of pkg-config and CMake modules in managing dependencies and development files for C or C++ Alpine Linux packages. Understand how these tools dynamically locate headers, libraries, and flags essential for building complex projects with static languages.
We'll cover the following...
Preface
Packages have to discover their required packages on the computer they’re built on. Since hardcoding the paths for the required headers, libraries, and so on doesn’t scale across different distributions (which may use different paths or configurations of dependencies), there are different mechanisms for dynamically discovering these. It’s important to understand how these work since we’ll interact with these systems for most packages written in statically compiled languages, like C or C++, that have dependencies.
The two most popular methods are pkg-config and CMake modules.
pkg-config
The pkg-config is a command-line utility that was first released in 2000. Its main purpose is to collect metadata about installed (development) packages and make it possible for packages to dynamically ...