FindLibLUV.cmake 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # - Try to find luv
  2. # Once done this will define
  3. # LIBLUV_FOUND - System has libluv
  4. # LIBLUV_INCLUDE_DIRS - The libluv include directories
  5. # LIBLUV_LIBRARIES - The libraries needed to use libluv
  6. find_package(PkgConfig)
  7. if (PKG_CONFIG_FOUND)
  8. pkg_check_modules(PC_LIBLUV QUIET luv)
  9. endif()
  10. set(LIBLUV_DEFINITIONS ${PC_LIBLUV_CFLAGS_OTHER})
  11. find_path(LIBLUV_INCLUDE_DIR luv/luv.h
  12. PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
  13. # Explicitly look for luv.so. #10407
  14. list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
  15. find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
  16. HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
  17. set(LIBLUV_LIBRARIES ${LIBLUV_LIBRARY})
  18. set(LIBLUV_INCLUDE_DIRS ${LIBLUV_INCLUDE_DIR})
  19. include(FindPackageHandleStandardArgs)
  20. # handle the QUIETLY and REQUIRED arguments and set LIBLUV_FOUND to TRUE
  21. # if all listed variables are TRUE
  22. find_package_handle_standard_args(LibLUV DEFAULT_MSG
  23. LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
  24. mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)