diff --git a/CMakeLists.txt b/CMakeLists.txt index f088aee..78d1db0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)