File: FindJack.cmake

package info (click to toggle)
cubicsdr 0.2.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,560 kB
  • sloc: cpp: 32,850; sh: 60; makefile: 6
file content (50 lines) | stat: -rw-r--r-- 988 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
# Try to find JACK
# This will define the following variables:
#
#  JACK_FOUND - Whether Jack was found.
#  JACK_INCLUDE_DIRS - Jack include directories.
#  JACK_LIBRARIES - Jack libraries.

include(FindPackageHandleStandardArgs)

if(JACK_LIBRARIES AND JACK_INCLUDE_DIRS)

  # in cache already
  set(JACK_FOUND TRUE)

else()

  find_package(PkgConfig)
  if(PKG_CONFIG_FOUND)
    pkg_check_modules(_JACK jack)
  endif(PKG_CONFIG_FOUND)

  find_path(JACK_INCLUDE_DIR
    NAMES
      jack/jack.h
    PATHS
      ${_JACK_INCLUDEDIR}
  )
  
  find_library(JACK_LIBRARY
    NAMES
      jack
    PATHS
      ${_JACK_LIBDIR}
  )

  set(JACK_INCLUDE_DIRS
    ${JACK_INCLUDE_DIR}
  )

  set(JACK_LIBRARIES
    ${JACK_LIBRARY}
  )

  find_package_handle_standard_args(Jack DEFAULT_MSG JACK_LIBRARIES JACK_INCLUDE_DIRS)

  # show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
  mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARY JACK_INCLUDE_DIRS JACK_LIBRARIES)

endif()