]> granicus.if.org Git - libevent/commitdiff
Search library name of Debug for find_event_lib.
authorHaowei Hsu <71438617+hwhsu1231@users.noreply.github.com>
Fri, 29 Jul 2022 12:58:27 +0000 (20:58 +0800)
committerAzat Khuzhin <a3at.mail@gmail.com>
Sun, 7 Aug 2022 09:14:40 +0000 (11:14 +0200)
cmake/LibeventConfig.cmake.in

index 7b808c3245436c8a77d7c4af805c94a1bab7f1ad..a12fc23c68cbff9560de4238a2acef695a0b35ca 100644 (file)
@@ -127,15 +127,25 @@ if(CONFIG_FOR_INSTALL_TREE)
 
     # Find libraries
     macro(find_event_lib _comp)
-        unset(_event_lib CACHE)
-        find_library(_event_lib
+        unset(_event_lib_dbg CACHE)
+        unset(_event_lib_rel CACHE)
+        find_library(_event_lib_dbg
+                    NAMES "event_${_comp}d"
+                    PATHS "${_INSTALL_PREFIX}/lib"
+                    NO_DEFAULT_PATH)
+        find_library(_event_lib_rel
                     NAMES "event_${_comp}"
                     PATHS "${_INSTALL_PREFIX}/lib"
                     NO_DEFAULT_PATH)
-        if(_event_lib)
+        if(_event_lib_rel OR _event_lib_dbg)
             list(APPEND LIBEVENT_LIBRARIES "libevent::${_comp}")
             set_case_insensitive_found(${_comp})
-            message_if_needed(STATUS "Found libevent component: ${_event_lib}")
+            if(_event_lib_dbg)
+                message_if_needed(STATUS "Found libevent component: ${_event_lib_dbg}")
+            endif()
+            if(_event_lib_rel)
+                message_if_needed(STATUS "Found libevent component: ${_event_lib_rel}")
+            endif()
         else()
             no_component_msg(${_comp})
         endif()