summary refs log tree commit diff stats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindLibSndFile.cmake23
-rw-r--r--cmake/FindPortaudio.cmake106
2 files changed, 129 insertions, 0 deletions
diff --git a/cmake/FindLibSndFile.cmake b/cmake/FindLibSndFile.cmake new file mode 100644 index 0000000..a177bde --- /dev/null +++ b/cmake/FindLibSndFile.cmake
@@ -0,0 +1,23 @@
1# Base Io build system
2# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
3#
4# Find libsndfile.
5
6FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h)
7
8SET(LIBSNDFILE_NAMES ${LIBSNDFILE_NAMES} sndfile libsndfile)
9FIND_LIBRARY(LIBSNDFILE_LIBRARY NAMES ${LIBSNDFILE_NAMES} PATH)
10
11IF(LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
12 SET(LIBSNDFILE_FOUND TRUE)
13ENDIF(LIBSNDFILE_INCLUDE_DIR AND LIBSNDFILE_LIBRARY)
14
15IF(LIBSNDFILE_FOUND)
16 IF(NOT LibSndFile_FIND_QUIETLY)
17 MESSAGE(STATUS "Found LibSndFile: ${LIBSNDFILE_LIBRARY}")
18 ENDIF (NOT LibSndFile_FIND_QUIETLY)
19ELSE(LIBSNDFILE_FOUND)
20 IF(LibSndFile_FIND_REQUIRED)
21 MESSAGE(FATAL_ERROR "Could not find sndfile")
22 ENDIF(LibSndFile_FIND_REQUIRED)
23ENDIF (LIBSNDFILE_FOUND) \ No newline at end of file
diff --git a/cmake/FindPortaudio.cmake b/cmake/FindPortaudio.cmake new file mode 100644 index 0000000..aa46935 --- /dev/null +++ b/cmake/FindPortaudio.cmake
@@ -0,0 +1,106 @@
1# - Try to find Portaudio
2# Once done this will define
3#
4# PORTAUDIO_FOUND - system has Portaudio
5# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
6# PORTAUDIO_LIBRARIES - Link these to use Portaudio
7# PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
8# PORTAUDIO_VERSION - Portaudio version
9#
10# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
11#
12# Redistribution and use is allowed according to the terms of the New BSD license.
13# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14#
15
16
17if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
18 # in cache already
19 set(PORTAUDIO_FOUND TRUE)
20else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
21 if (NOT WIN32)
22 include(FindPkgConfig)
23 pkg_check_modules(PORTAUDIO2 portaudio-2.0)
24 endif (NOT WIN32)
25
26 if (PORTAUDIO2_FOUND)
27 set(PORTAUDIO_INCLUDE_DIRS
28 ${PORTAUDIO2_INCLUDE_DIRS}
29 )
30 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
31 set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
32 else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
33 set(PORTAUDIO_LIBRARIES
34 ${PORTAUDIO2_LIBRARIES}
35 )
36 endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
37 set(PORTAUDIO_VERSION
38 19
39 )
40 set(PORTAUDIO_FOUND TRUE)
41 else (PORTAUDIO2_FOUND)
42 find_path(PORTAUDIO_INCLUDE_DIR
43 NAMES
44 portaudio.h
45 PATHS
46 /usr/include
47 /usr/local/include
48 /opt/local/include
49 /sw/include
50 )
51
52 find_library(PORTAUDIO_LIBRARY
53 NAMES
54 portaudio
55 PATHS
56 /usr/lib
57 /usr/local/lib
58 /opt/local/lib
59 /sw/lib
60 )
61
62 find_path(PORTAUDIO_LIBRARY_DIR
63 NAMES
64 portaudio
65 PATHS
66 /usr/lib
67 /usr/local/lib
68 /opt/local/lib
69 /sw/lib
70 )
71
72 set(PORTAUDIO_INCLUDE_DIRS
73 ${PORTAUDIO_INCLUDE_DIR}
74 )
75 set(PORTAUDIO_LIBRARIES
76 ${PORTAUDIO_LIBRARY}
77 )
78
79 set(PORTAUDIO_LIBRARY_DIRS
80 ${PORTAUDIO_LIBRARY_DIR}
81 )
82
83 set(PORTAUDIO_VERSION
84 18
85 )
86
87 if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
88 set(PORTAUDIO_FOUND TRUE)
89 endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
90
91 if (PORTAUDIO_FOUND)
92 if (NOT Portaudio_FIND_QUIETLY)
93 message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
94 endif (NOT Portaudio_FIND_QUIETLY)
95 else (PORTAUDIO_FOUND)
96 if (Portaudio_FIND_REQUIRED)
97 message(FATAL_ERROR "Could not find Portaudio")
98 endif (Portaudio_FIND_REQUIRED)
99 endif (PORTAUDIO_FOUND)
100 endif (PORTAUDIO2_FOUND)
101
102
103 # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
104 mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
105
106endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)