Merge pull request #1238 from jktjkt/cmake-fix-libevent-detection

cmake: Fix libevent version detection
This commit is contained in:
Tatsuhiro Tsujikawa 2018-11-15 17:11:02 +09:00 committed by GitHub
commit cf48a56d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ if(LIBEVENT_INCLUDE_DIR)
# Libevent 2.0
file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h"
LIBEVENT_VERSION REGEX "${_version_regex}")
if("${LIBEVENT_VERSION}" STREQUAL "")
set(LIBEVENT_VERSION ${PC_LIBEVENT_VERSION})
endif()
else()
# Libevent 1.4
file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event-config.h"