Bug 421362

Summary: find_package XCB Warning (dev) invalid package name passed to find_package_handle_standard_args does not match calling package
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Alex <alex>
Component: generalAssignee: ecm-bugs-null <ecm-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.70.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.71.0
Sentry Crash Report:

Description Alex 2020-05-11 18:58:23 UTC
SUMMARY
The package name passed to `find_package_handle_standard_args` (XCB_XKB) does not match the name of the calling package (XCB).

STEPS TO REPRODUCE
1. find_package(XCB REQUIRED COMPONENTS XCB XKB)


OBSERVED RESULT
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (XCB_XCB)
  does not match the name of the calling package (XCB).  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/ECM/modules/ECMFindModuleHelpers.cmake:248 (find_package_handle_standard_args)
  /usr/share/ECM/find-modules/FindXCB.cmake:183 (ecm_find_package_handle_library_components)
  CMakeLists.txt:204 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found XCB_XCB: /usr/lib64/libxcb.so (found version "1.14") 
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (XCB_XKB)
  does not match the name of the calling package (XCB).  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/ECM/modules/ECMFindModuleHelpers.cmake:248 (find_package_handle_standard_args)
  /usr/share/ECM/find-modules/FindXCB.cmake:183 (ecm_find_package_handle_library_components)
  CMakeLists.txt:204 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.


EXPECTED RESULT
No Warning and correct variable names.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Base System release 2.7
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
CMake Version: 3.17.2
Comment 1 Christophe Marin 2020-05-11 20:45:06 UTC
Already fixed https://phabricator.kde.org/D29396
Comment 2 Alex 2020-05-11 22:23:03 UTC
Awesome, thanks!