Bug 441604 - find_dependency(inotify) returns false despite find_package(inotify) returning true
Summary: find_dependency(inotify) returns false despite find_package(inotify) returnin...
Status: CLOSED FIXED
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.84.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: ecm-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-27 13:27 UTC by Dawid Wróbel
Modified: 2022-10-19 15:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.