WIP towards parallel parsing
[dyninst.git] / cmake / Modules / FindLibDwarf.cmake
1 # - Try to find libdwarf
2 # Once done this will define
3 #
4 #  LIBDWARF_FOUND - system has libdwarf
5 #  LIBDWARF_INCLUDE_DIRS - the libdwarf include directory
6 #  LIBDWARF_LIBRARIES - Link these to use libdwarf
7 #  LIBDWARF_DEFINITIONS - Compiler switches required for using libdwarf
8 #
9
10
11 if (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
12   set (LibDwarf_FIND_QUIETLY TRUE)
13 endif (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
14
15 find_path (LIBDWARF_INCLUDE_DIR
16   NAMES
17   libdwarf.h
18   HINTS
19   ${LIBDWARF_INCLUDE_DIRS}
20   PATHS
21   /usr/include
22   /usr/include/libdwarf
23   /usr/local/include
24   /opt/local/include
25   /sw/include
26   ENV CPATH) # PATH and INCLUDE will also work
27
28 find_library (LIBDWARF_LIBRARIES
29   NAMES
30   dwarf
31   HINTS
32   ${LIBDWARF_LIBRARIES}
33   PATHS
34   /usr/lib
35   /usr/lib64
36   /usr/local/lib
37   /usr/local/lib64
38   /opt/local/lib
39   /opt/local/lib64
40   /sw/lib
41   ENV LIBRARY_PATH   # PATH and LIB will also work
42   ENV LD_LIBRARY_PATH)
43 include (FindPackageHandleStandardArgs)
44
45
46 # handle the QUIETLY and REQUIRED arguments and set LIBDWARF_FOUND to TRUE
47 # if all listed variables are TRUE
48 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDwarf DEFAULT_MSG
49   LIBDWARF_LIBRARIES
50   LIBDWARF_INCLUDE_DIR)
51
52 #mark_as_advanced(LIBDW_INCLUDE_DIR DWARF_INCLUDE_DIR)
53 #mark_as_advanced(LIBDWARF_INCLUDE_DIRS LIBDWARF_LIBRARIES)