1# Locate libuvent library
2# This module defines
3#  HAVE_LIBUV, if false, do not try to link with libuvent
4#  LIBUV_LIBRARIES, Library path and libs
5#  LIBUV_INCLUDE_DIR, where to find the ICU headers
6
7FIND_PATH(LIBUV_INCLUDE_DIR uv.h
8          HINTS
9               ${LIBUV_ROOT}
10          PATH_SUFFIXES include
11          PATHS
12               ~/Library/Frameworks
13               /Library/Frameworks
14               /opt/local
15               /opt/csw
16               /opt/libuv
17               /opt)
18MESSAGE(STATUS "Found UV include dir: ${LIBUV_INCLUDE_DIR}")
19
20IF(WIN32)
21    FIND_LIBRARY(LIBUV_LIBRARIES_DEBUG
22        NAMES uv libuv
23        HINTS ${LIBUV_ROOT}
24        PATH_SUFFIXES Debug Debug/lib)
25
26    FIND_LIBRARY(LIBUV_LIBRARIES_OPTIMIZED
27        NAMES uv libuv
28        HINTS ${LIBUV_ROOT}
29        PATH_SUFFIXES Release Release/lib)
30
31    SET(LIBUV_LIBRARIES
32        OPTIMIZED ${LIBUV_LIBRARIES_OPTIMIZED}
33        DEBUG ${LIBUV_LIBRARIES_DEBUG})
34
35ELSE()
36    FIND_LIBRARY(LIBUV_LIBRARIES
37        NAMES uv
38        HINTS ${LIBUV_ROOT}
39        PATH_SUFFIXES lib
40        PATHS
41            ~/Library/Frameworks
42            /Library/Frameworks
43            /opt/local
44            /opt/csw
45            /opt/libuv
46            /opt)
47ENDIF(WIN32)
48
49
50IF (LIBUV_LIBRARIES)
51  SET(HAVE_LIBUV true)
52  MESSAGE(STATUS "Found libuv in ${LIBUV_INCLUDE_DIR} : ${LIBUV_LIBRARIES}")
53ELSE (LIBUV_LIBRARIES)
54  SET(HAVE_LIBUV false)
55ENDIF (LIBUV_LIBRARIES)
56
57MARK_AS_ADVANCED(HAVE_LIBUV LIBUV_INCLUDE_DIR LIBUV_LIBRARIES LIBUV_ROOT)
58