FindPkgConfig: Deprecate PKG_CONFIG_FOUND

Since most of the find modules use the `<PackageName>_FOUND` result
variables, this now also syncs it for the FindPkgConfig module. The
`PkgConfig_FOUND` result variable is available since CMake 3.3 and
contains the same value. There is also `PKGCONFIG_FOUND` result variable
automatically set with the same value but for simplicity isn't
documented. The uppercased `<PACKAGENAME>_FOUND` result variables set by
find modules are also considered legacy variables.
This commit is contained in:
Peter Kokot
2025-08-21 01:01:33 +02:00
parent 9e89400d13
commit 9e3d2cd94f
25 changed files with 44 additions and 29 deletions

View File

@@ -415,7 +415,7 @@ starting point.
.. code-block:: cmake
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
if(PkgConfig_FOUND)
pkg_check_modules(PC_Foo QUIET Foo)
endif()

View File

@@ -77,6 +77,10 @@ Find Modules
result variable. The ``PKG_CONFIG_VERSION_STRING`` result variable is
deprecated.
* The :module:`FindPkgConfig` module's result variable ``PKG_CONFIG_FOUND``
is deprecated in favor of ``PkgConfig_FOUND``, which is available since
CMake 3.3 and has the same value.
* The :module:`FindPNG` module now provides a ``PNG_VERSION`` result
variable. The ``PNG_VERSION_STRING`` result variable is deprecated.