Erroneous package name mismatch warning with nested FindPackage
After creating a FindPackage module which first runs find_package(PkgConfig QUIET)
, as the module tries to find its package by using pkg-config first before trying other strategies, CMake issues the following warning:
The package name passed to `find_package_handle_standard_args` (PkgConfig)
does not match the name of the calling package (Atf-C). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
/usr/share/cmake-3.17/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
cmake/FindAtf-C.cmake:1 (include)
CMakeLists.txt:33 (find_package)
This warning is erroneous - FindPkgConfig is calling find_package_handle_standard args, NOT FindAtf-C.