diff --git a/cmake/modules/ExternalLibraryHelper.cmake b/cmake/modules/ExternalLibraryHelper.cmake --- a/cmake/modules/ExternalLibraryHelper.cmake +++ b/cmake/modules/ExternalLibraryHelper.cmake @@ -6,7 +6,7 @@ cmake_parse_arguments(ARG "" "" - "HINTS;INCLUDE_DIRS;NAMES;PATHS;PATH_SUFFIXES" + "HINTS;INCLUDE_DIRS;INTERFACE_LINK_LIBRARIES;NAMES;PATHS;PATH_SUFFIXES" ${ARGN} ) @@ -28,7 +28,10 @@ set(${LIB}_${COMPONENT}_FOUND TRUE PARENT_SCOPE) # ... and append the library path to the LIBRARIES variable ... - list(APPEND ${LIB}_LIBRARIES "${${LIB}_${COMPONENT}_LIBRARY}") + list(APPEND ${LIB}_LIBRARIES + "${${LIB}_${COMPONENT}_LIBRARY}" + ${ARG_INTERFACE_LINK_LIBRARIES} + ) list(REMOVE_DUPLICATES ${LIB}_LIBRARIES) set(${LIB}_LIBRARIES ${${LIB}_LIBRARIES} PARENT_SCOPE) @@ -42,6 +45,9 @@ set_property(TARGET ${LIB}::${COMPONENT} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ARG_INCLUDE_DIRS} ) + set_property(TARGET ${LIB}::${COMPONENT} PROPERTY + INTERFACE_LINK_LIBRARIES ${ARG_INTERFACE_LINK_LIBRARIES} + ) endif() find_package_message("${LIB}_${COMPONENT}" diff --git a/cmake/modules/FindEvent.cmake b/cmake/modules/FindEvent.cmake --- a/cmake/modules/FindEvent.cmake +++ b/cmake/modules/FindEvent.cmake @@ -46,14 +46,9 @@ HINTS "${BREW_HINT}" INCLUDE_DIRS ${Event_INCLUDE_DIRS} PATHS ${PC_Event_LIBRARY_DIRS} + INTERFACE_LINK_LIBRARIES "$<$:ws2_32;shell32;advapi32>" ) - set(_Event_WINDOWS_LIBRARIES "$<$:ws2_32;shell32;advapi32>") - set_property(TARGET Event::event - PROPERTY INTERFACE_LINK_LIBRARIES ${_Event_WINDOWS_LIBRARIES} - ) - list(APPEND Event_LIBRARIES ${_Event_WINDOWS_LIBRARIES}) - pkg_check_modules(PC_Event_pthreads QUIET event_pthreads libevent_pthreads) find_component(Event pthreads NAMES event_pthreads