File: FindLibev.cmake

package info (click to toggle)
getdns 1.7.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,752 kB
  • sloc: ansic: 57,351; sh: 407; xml: 38; makefile: 22
file content (63 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#[=======================================================================[.rst:
FindLibev
---------

Find the Libev library.

Imported targets
^^^^^^^^^^^^^^^^

This module defines the following :prop_tgt:`IMPORTED` targets:

``Libev::Libev``
  The Libev library, if found.

Result variables
^^^^^^^^^^^^^^^^

This module will set the following variables in your project:

``Libev_FOUND``
  If false, do not try to use Libev.
``LIBEV_INCLUDE_DIR``
  where to find libev headers.
``LIBEV_LIBRARIES``
  the libraries needed to use Libev.
``LIBEV_VERSION``
  the version of the Libev library found

#]=======================================================================]

find_path(LIBEV_INCLUDE_DIR ev.h
  HINTS
  "${LIBEV_DIR}"
  "${LIBEV_DIR}/include"
)

find_library(LIBEV_LIBRARY NAMES ev libev
  HINTS
  "${LIBEV_DIR}"
  "${LIBEV_DIR}/lib"
)

set(LIBEV_LIBRARIES "")

if (LIBEV_INCLUDE_DIR AND LIBEV_LIBRARY)
  if (NOT TARGET Libev::Libev)
    add_library(Libev::Libev UNKNOWN IMPORTED)
    set_target_properties(Libev::Libev PROPERTIES
      INTERFACE_INCLUDE_DIRECTORIES "${LIBEV_INCLUDE_DIR}"
      IMPORTED_LINK_INTERFACE_LANGUAGES "C"
      IMPORTED_LOCATION "${LIBEV_LIBRARY}"
      )
  endif ()
endif()

list(APPEND LIBEV_LIBRARIES "${LIBEV_LIBRARY}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libev
  REQUIRED_VARS LIBEV_LIBRARIES LIBEV_INCLUDE_DIR
  )

mark_as_advanced(LIBEV_INCLUDE_DIR LIBEV_LIBRARIES LIBEV_LIBRARY)