summaryrefslogtreecommitdiff
path: root/src/FindFaad.cmake
blob: 724b82fb358efc14d7512d17754806c7bf82b48a (plain)
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
#  FAAD_INCLUDE_DIRS - where to find faad.h, etc.
#  FAAD_LIBRARIES    - List of libraries when using libfaad.
#  FAAD_FOUND        - True if libfaad found.

# Look for the header file.
FIND_PATH(FAAD_INCLUDE_DIR NAMES faad.h)
MARK_AS_ADVANCED(FAAD_INCLUDE_DIR)

# Look for the library.
FIND_LIBRARY(FAAD_LIBRARY NAMES faad)
MARK_AS_ADVANCED(FAAD_LIBRARY)

# Copy the results to the output variables.
IF(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
  SET(FAAD_FOUND 1)
  SET(FAAD_LIBRARIES ${FAAD_LIBRARY})
  SET(FAAD_INCLUDE_DIRS ${FAAD_INCLUDE_DIR})
ELSE(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)
  SET(FAAD_FOUND 0)
  SET(FAAD_LIBRARIES)
  SET(FAAD_INCLUDE_DIRS)
ENDIF(FAAD_INCLUDE_DIR AND FAAD_LIBRARY)

# Report the results.
IF(NOT FAAD_FOUND)
  SET(FAAD_DIR_MESSAGE
    "FAAD was not found. Make sure FAAD_LIBRARY and FAAD_INCLUDE_DIR are set.")
  IF(NOT FAAD_FIND_QUIETLY)
    MESSAGE(STATUS "${FAAD_DIR_MESSAGE}")
  ELSE(NOT FAAD_FIND_QUIETLY)
    IF(FAAD_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "${FAAD_DIR_MESSAGE}")
    ENDIF(FAAD_FIND_REQUIRED)
  ENDIF(NOT FAAD_FIND_QUIETLY)
ENDIF(NOT FAAD_FOUND)