forked from bpftrace/bpftrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindLibDw.cmake
41 lines (35 loc) · 970 Bytes
/
FindLibDw.cmake
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
# - Try to find libdw
# Once done this will define
#
# LIBDW_FOUND - system has libdw
# LIBDW_INCLUDE_DIRS - the libdw include directory
# LIBDW_LIBRARIES - Link these to use libdw
# LIBDW_DEFINITIONS - Compiler switches required for using libdw
#
if (LIBDW_LIBRARIES AND LIBDW_INCLUDE_DIRS)
set (LibDw_FIND_QUIETLY TRUE)
endif (LIBDW_LIBRARIES AND LIBDW_INCLUDE_DIRS)
find_path (LIBDW_INCLUDE_DIRS
NAMES
libdw.h
libdwfl.h
PATH_SUFFIXES
elfutils
libdw
PATHS
ENV CPATH)
find_library (LIBDW_LIBRARIES
NAMES
dw
PATH_SUFFIXES
elfutils
libdw
PATHS
ENV LIBRARY_PATH
ENV LD_LIBRARY_PATH)
include (FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBDW_FOUND to TRUE if all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDw "Please install the libdw development package"
LIBDW_LIBRARIES
LIBDW_INCLUDE_DIRS)
mark_as_advanced(LIBDW_INCLUDE_DIRS LIBDW_LIBRARIES)