FindPkgConfig docs for PKG_CONFIG_ARGN are misleading
New for CMake 3.22, !6222 (merged) adds a new PKG_CONFIG_ARGN
variable for the FindPkgConfig
module. The docs contain both conflicting and misleading information about this new variable. The start of the docs list PKG_CONFIG_ARGN
as one of the variables that the module sets. This is only half true, as it is set as a cache variable, so after it has been set once, it won't be changed by the module. Furthermore, being a cache variable, it can be modified by the user. The variable is mentioned again in the Variables Affecting Behavior section, this time as a variable that the user may set. These two sections seem to be in conflict -- the first portrays it as a variable the module sets, the latter section paints it as a variable intended for the user to set.
Looking at the implementation, it seems that the intention is that this is a user-modifiable variable, but it is initialised from the PKG_CONFIG
environment variable. The first section should be updated to make the way the PKG_CONFIG_EXECUTABLE
and PKG_CONFIG_ARGN
variables are set and intended to be used clearer.