scide: DocumentManager - fix default selection length when opening file
[supercollider.git] / cmake_modules / FindJack.cmake
blob44417deb36e65d99b45e02940dad24022063acb8
1 # - Try to find jack-2.6
2 # Once done this will define
4 #  JACK_FOUND - system has jack
5 #  JACK_INCLUDE_DIRS - the jack include directory
6 #  JACK_LIBRARIES - Link these to use jack
7 #  JACK_DEFINITIONS - Compiler switches required for using jack
9 #  Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
10 #  Modified for other libraries by Lasse Kärkkäinen <tronic>
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.
17 if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
18   # in cache already
19   set(JACK_FOUND TRUE)
20 else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)
21   # use pkg-config to get the directories and then use these values
22   # in the FIND_PATH() and FIND_LIBRARY() calls
23   if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
24     include(UsePkgConfig)
25     pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS)
26   else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
27     find_package(PkgConfig)
28     if (PKG_CONFIG_FOUND)
29       pkg_check_modules(_JACK jack)
30     endif (PKG_CONFIG_FOUND)
31   endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
32   find_path(JACK_INCLUDE_DIR
33     NAMES
34       jack/jack.h
35     PATHS
36       ${_JACK_INCLUDEDIR}
37       /usr/include
38       /usr/local/include
39       /opt/local/include
40       /sw/include
41   )
42   
43   find_library(JACK_LIBRARY
44     NAMES
45       jack
46     PATHS
47       ${_JACK_LIBDIR}
48       /usr/lib
49       /usr/local/lib
50       /opt/local/lib
51       /sw/lib
52   )
54   if (JACK_LIBRARY)
55     set(JACK_FOUND TRUE)
56   endif (JACK_LIBRARY)
58   set(JACK_INCLUDE_DIRS
59     ${JACK_INCLUDE_DIR}
60   )
62   if (JACK_FOUND)
63     set(JACK_LIBRARIES
64       ${JACK_LIBRARIES}
65       ${JACK_LIBRARY}
66     )
67   endif (JACK_FOUND)
69   if (JACK_INCLUDE_DIRS AND JACK_LIBRARIES)
70      set(JACK_FOUND TRUE)
71   endif (JACK_INCLUDE_DIRS AND JACK_LIBRARIES)
73   if (JACK_FOUND)
74     if (NOT JACK_FIND_QUIETLY)
75       message(STATUS "Found jack: ${JACK_LIBRARY}")
76     endif (NOT JACK_FIND_QUIETLY)
77   else (JACK_FOUND)
78     if (JACK_FIND_REQUIRED)
79       message(FATAL_ERROR "Could not find JACK")
80     endif (JACK_FIND_REQUIRED)
81   endif (JACK_FOUND)
83   # show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view
84   mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES)
86 endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS)