Bug 441604

Summary: find_dependency(inotify) returns false despite find_package(inotify) returning true
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Dawid Wróbel <me>
Component: generalAssignee: ecm-bugs-null <ecm-bugs-null>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.84.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Dawid Wróbel 2021-08-27 13:27:59 UTC
SUMMARY
I was working on a patch for kcoreaddons that would add support for static builds: 
https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/129#note_294344

For some reason, while find_package(Inotify) returns true, the corresponding find_dependency(Inotify) returns false. 


STEPS TO REPRODUCE
1. Apply the patch from the PR mentioned above (not that it only applies to static builds, so feel free to remove the condition)
2. Build under Linux and then try to consume the lib from another project 


OBSERVED RESULT
find_dependency(Inotify) fails, despite find_package(Inotify) having returned true. Replacing find_dependency() with find_package() in Config.cmake file also works.

EXPECTED RESULT
find_dependency() should return True.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Dawid Wróbel 2022-09-16 20:41:10 UTC
It was simply sorted by moving the find_dependency() further up in the Config.cmake.in, right after the include(CMakeFindDependencyMacro) call.