Skip to content

Commit

Permalink
[!] fix compability with elder versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kulsk committed Oct 31, 2023
1 parent 769b032 commit 0c07298
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmake/FindLibEvent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ find_path (LIBEVENT_INCLUDE_DIR NAMES event.h)
# find dynamic library
find_library (LIBEVENT_LIBRARY NAMES event)

# find static library
find_library (LIBEVENT_LIBRARY_STATIC NAMES libevent.a)


# find version
if(LIBEVENT_INCLUDE_DIR)
set(_version_regex "^#define[ ]+EVENT__VERSION[ ]+\"([^\"]+)\"")
set(_version_regex "^#define[ ]+[EVENT__VERSION|_EVENT_VERSION]+[ ]+\"([^\"]+)\"")
file(STRINGS "${LIBEVENT_INCLUDE_DIR}/event2/event-config.h"
LIBEVENT_VERSION REGEX "${_version_regex}")
string(REGEX REPLACE "${_version_regex}" "\\1"
Expand All @@ -21,12 +17,10 @@ if(LIBEVENT_INCLUDE_DIR)
endif()



include (FindPackageHandleStandardArgs)
set (LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIR})
set (LIBEVENT_LIBRARIES
${LIBEVENT_LIBRARY}
${LIBEVENT_LIBRARY_STATIC}
${LIBEVENT_SSL}
${LIBEVENT_CORE}
${LIBEVENT_EXTRA}
Expand All @@ -38,7 +32,6 @@ find_package_handle_standard_args(LibEvent
LIBEVENT_INCLUDE_DIR
LIBEVENT_LIBRARY
LIBEVENT_LIBRARIES
LIBEVENT_LIBRARY_STATIC
VERSION_VAR LIBEVENT_VERSION
)

Expand Down

0 comments on commit 0c07298

Please sign in to comment.