2019-06-10 05:13:18 -07:00
|
|
|
# - Try to find luv
|
|
|
|
# Once done this will define
|
|
|
|
# LIBLUV_FOUND - System has libluv
|
|
|
|
# LIBLUV_INCLUDE_DIRS - The libluv include directories
|
|
|
|
# LIBLUV_LIBRARIES - The libraries needed to use libluv
|
|
|
|
|
2019-06-29 12:49:49 -07:00
|
|
|
find_package(PkgConfig)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(PC_LIBLUV QUIET luv)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(LIBLUV_DEFINITIONS ${PC_LIBLUV_CFLAGS_OTHER})
|
|
|
|
|
2019-06-10 05:13:18 -07:00
|
|
|
find_path(LIBLUV_INCLUDE_DIR luv/luv.h
|
2019-06-29 12:49:49 -07:00
|
|
|
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
|
2019-06-10 05:13:18 -07:00
|
|
|
|
2019-08-12 09:22:02 -07:00
|
|
|
# Explicitly look for luv.so. #10407
|
2021-08-14 05:53:52 -07:00
|
|
|
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
2019-06-10 05:13:18 -07:00
|
|
|
|
|
|
|
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
|
2019-06-29 12:49:49 -07:00
|
|
|
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
|
2019-06-10 05:13:18 -07:00
|
|
|
|
|
|
|
set(LIBLUV_LIBRARIES ${LIBLUV_LIBRARY})
|
|
|
|
set(LIBLUV_INCLUDE_DIRS ${LIBLUV_INCLUDE_DIR})
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set LIBLUV_FOUND to TRUE
|
|
|
|
# if all listed variables are TRUE
|
2019-06-20 18:48:46 -07:00
|
|
|
find_package_handle_standard_args(LibLUV DEFAULT_MSG
|
2019-06-10 05:13:18 -07:00
|
|
|
LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
|
|
|
|
|
|
|
|
mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)
|