Skip to content

Commit

Permalink
both: prefer pkg-config over cmake in libevent
Browse files Browse the repository at this point in the history
  • Loading branch information
liudongmiao committed Jun 12, 2024
1 parent 4f6f132 commit 0e3658f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ if (HAVE_OSSL_QUIC_CLIENT_METHOD)
endif()
unset(CMAKE_REQUIRED_LIBRARIES)

find_package(Libevent 2.1.1 COMPONENTS core)
if (Libevent_FOUND)
set(EVENT_CORE libevent::core)
include_directories(${LIBEVENT_INCLUDE_DIRS})
else()
find_package(PkgConfig REQUIRED)
find_package(PkgConfig QUIET)
if (PkgConfig_FOUND)
pkg_check_modules(LIBEVENT_CORE REQUIRED libevent_core>=2.1.1)
set(EVENT_CORE ${LIBEVENT_CORE_LINK_LIBRARIES})
include_directories(${LIBEVENT_CORE_INCLUDE_DIRS})
else()
find_package(Libevent 2.1.1 REQUIRED COMPONENTS core)
set(EVENT_CORE libevent::core)
include_directories(${LIBEVENT_INCLUDE_DIRS})
endif()

add_executable(wss-proxy-client wss-proxy-client.c ws-header.c common.c wss-client.c)
Expand Down

0 comments on commit 0e3658f

Please sign in to comment.