mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00

The current cmake/LibeventConfig.cmake.in has a few problems and I'm not sure how cleanly developed it is. It seems rater complex for the little things I would assume it needs to do. I found two problems that are fixed in this PR: - If the downstream user does not explicitly set LIBEVENT_STATIC_LINK before calling find_package(libevent) then they will not be able to detect the static library, even if its the only one that exists. Since this may be rather strict, I've changed the behavior so that LIBEVENT_STATIC_LINK can be set to ON or OFF, but if unset, it defaults to whatever configuration libevent was built as. - The other problem is a bug. The package configuration needs to unset CMAKE_FIND_LIBRARY_SUFFIXES after use, otherwise all packages that are detected after libevent will be "infected" by this setting. This was a significant problem for us, and is very hard to detect in downstream project, because the order of dependencies will lead to different search results. (cherry picked from commit 1675a55620e6f0bbba5776f2df72cd48920421c2)