File: FindBfd.cmake

package info (click to toggle)
mlpack 4.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,272 kB
  • sloc: cpp: 226,039; python: 1,934; sh: 1,198; lisp: 414; makefile: 85
file content (89 lines) | stat: -rw-r--r-- 1,986 bytes parent folder | download | duplicates (5)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# - Try to find libbfd
# Once done this will define
#
#  LIBBFD_FOUND - system has libbfd
#  LIBBFD_INCLUDE_DIRS - the libbfd include directory
#  LIBBFD_LIBRARIES - Link these to use libbfd
#  LIBBFD_DEFINITIONS - Compiler switches required for using libbfd
#
# Based on:
#
#  Copyright (c) 2008 Bernhard Walle <bernhard.walle@gmx.de>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#


if (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS)
  set (LIBBFD_FIND_QUIETLY TRUE)
endif ()

find_path (LIBBFD_INCLUDE_DIRS
    NAMES
      bfd.h
      dis-asm.h
    PATHS
      /usr/include
      /usr/local/include
      /opt/local/include
      /opt/include
      ENV CPATH)

# Ugly, yes ugly...
find_library (LIBBFD_BFD_LIBRARY
    NAMES
      bfd
    PATHS
      /usr/lib
      /usr/lib64
      /usr/local/lib
      /usr/local/lib64
      /usr/include
      /opt/local/lib
      /opt/usr/lib64
      ENV LIBRARY_PATH
      ENV LD_LIBRARY_PATH)

#find_library (LIBBFD_IBERTY_LIBRARY
#    NAMES
#      iberty
#    PATHS
#      /usr/lib
#      /usr/lib64
#      /usr/local/lib
#      /usr/local/lib64
#      /usr/include
#      /opt/local/lib
#      /opt/usr/lib64
#      ENV LIBRARY_PATH
#      ENV LD_LIBRARY_PATH)

#find_library (LIBBFD_OPCODES_LIBRARY
#    NAMES
#      opcodes
#    PATHS
#      /usr/lib
#      /usr/lib64
#      /usr/local/lib
#      /usr/local/lib64
#      /usr/include
#      /opt/local/lib
#      /opt/usr/lib64
#      ENV LIBRARY_PATH
#      ENV LD_LIBRARY_PATH)


include (FindPackageHandleStandardArgs)


# handle the QUIETLY and REQUIRED arguments and set LIBBFD_FOUND to TRUE if all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBBFD DEFAULT_MSG
    LIBBFD_BFD_LIBRARY
#    LIBBFD_IBERTY_LIBRARY
#    LIBBFD_OPCODES_LIBRARY
    LIBBFD_INCLUDE_DIRS)

set(LIBBFD_LIBRARIES "${LIBBFD_BFD_LIBRARY}")
mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES)