Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 82 lines (70 sloc) 2.035 kb
73480be4 » Kasper Laudrup
2011-04-28 CMake module for finding jacklib
1 # - Try to find jack-2.6
2 # Once done this will define
3 #
4 # JACK_FOUND - system has jack
5 # JACK_INCLUDE_DIR - the jack include directory
6 # JACK_LIBRARIES - Link these to use jack
7 # JACK_DEFINITIONS - Compiler switches required for using jack
8 #
9 # Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
10 # Modified for other libraries by Lasse Kärkkäinen <tronic>
11 #
12 # Redistribution and use is allowed according to the terms of the New
13 # BSD license.
14 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
15 #
16
17 if (JACK_LIBRARIES AND JACK_INCLUDE_DIR)
18 # in cache already
19 set(JACK_FOUND TRUE)
20 else (JACK_LIBRARIES AND JACK_INCLUDE_DIR)
21 # use pkg-config to get the directories and then use these values
22 # in the FIND_PATH() and FIND_LIBRARY() calls
23 find_package(PkgConfig)
24 if (PKG_CONFIG_FOUND)
25 pkg_check_modules(_JACK jack)
26 endif (PKG_CONFIG_FOUND)
27
28 find_path(JACK_INCLUDE_DIR
29 NAMES
30 jack/jack.h
31 PATHS
32 ${_JACK_INCLUDEDIR}
33 /usr/include
34 /usr/local/include
35 /opt/local/include
36 )
37
38 find_library(JACK_LIBRARY
39 NAMES
40 jack
41 PATHS
42 ${_JACK_LIBDIR}
43 /usr/lib
44 /usr/local/lib
45 /opt/local/lib
46 )
47
48 if (JACK_LIBRARY)
49 set(JACK_FOUND TRUE)
50 endif (JACK_LIBRARY)
51
52 set(JACK_INCLUDE_DIR
53 ${JACK_INCLUDE_DIR}
54 )
55
56 if (JACK_FOUND)
57 set(JACK_LIBRARIES
58 ${JACK_LIBRARIES}
59 ${JACK_LIBRARY}
60 )
61 endif (JACK_FOUND)
62
63 if (JACK_INCLUDE_DIR AND JACK_LIBRARIES)
64 set(JACK_FOUND TRUE)
65 endif (JACK_INCLUDE_DIR AND JACK_LIBRARIES)
66
67 if (JACK_FOUND)
68 if (NOT JACK_FIND_QUIETLY)
69 message(STATUS "Found jack: ${JACK_LIBRARY} ${JACK_INCLUDE_DIR}")
70 endif (NOT JACK_FIND_QUIETLY)
71 else (JACK_FOUND)
72 if (JACK_FIND_REQUIRED)
73 message(FATAL_ERROR "Could not find JACK")
74 endif (JACK_FIND_REQUIRED)
75 endif (JACK_FOUND)
76
77 # show the JACK_INCLUDE_DIR and JACK_LIBRARIES variables only in the advanced view
78 mark_as_advanced(JACK_INCLUDE_DIR JACK_LIBRARIES)
79
80 endif (JACK_LIBRARIES AND JACK_INCLUDE_DIR)
81
82
Something went wrong with that request. Please try again.