new audio engine backend for native CoreAudio audio I/O, and PortMIDI for MIDI.
[ardour.git] / libs / backends / wavesaudio / portmidi / src / pm_mac / README_MAC.txt
1 README_MAC.txt for PortMidi\r
2 Roger Dannenberg\r
3 20 nov 2009\r
4 revised 20 Sep 2010 for Xcode 3.2.4 and CMake 8.2-2\r
5 \r
6 To build PortMidi for Mac OS X, you must install Xcode and\r
7 CMake.\r
8 \r
9 CMake can build either command-line Makefiles or Xcode projects.\r
10 These approaches are described in separate sections below.\r
11 \r
12 ==== CLEANING UP ====\r
13 (Skip this for now, but later you might want start from a clean\r
14 slate.)\r
15 \r
16 Start in the portmedia/portmidi directory.\r
17 \r
18 make -f pm_mac/Makefile.osx clean\r
19 \r
20 will remove .o, CMakeFiles, and other intermediate files.\r
21 \r
22 Using "cleaner" instead of "clean" will also remove jni-related \r
23 intermediate files.\r
24 \r
25 Using "cleanest" instead of "clean" or "cleaner" will also remove\r
26 application binaries and the portmidi libraries. (It will not \r
27 uninstall anything, however.)\r
28 \r
29 ==== USING CMAKE (AND COMMAND LINE TOOLS) ====\r
30 \r
31 Start in the portmedia/portmidi directory.\r
32 \r
33 make -f pm_mac/Makefile.osx\r
34 \r
35 (Begin note: make will invoke cmake to build a Makefile and then make to\r
36 build portmidi. This extra level allows you to correctly build \r
37 both Release and Debug versions. Release is the default, so to get\r
38 the Debug version, use:\r
39 \r
40 make -f pm_mac/Makefile.osx configuration=Debug\r
41 )\r
42 \r
43 Release version executables and libraries are now in\r
44     portmedia/portmidi/Release\r
45 \r
46 Debug version executables and libraries are created in\r
47     portmedia/portmidi/Debug\r
48 The Debug versions are compiled with PM_CHECK_ERRORS which\r
49 prints an error message and aborts when an error code is returned\r
50 by PortMidi functions. This is useful for small command line \r
51 applications. Otherwise, you should check and handle error returns\r
52 in your program.\r
53 \r
54 You can install portmidi as follows:\r
55 \r
56 cd Release; sudo make install\r
57 \r
58 This will install /usr/local/include/{portmidi.h, porttime.h}\r
59 and /usr/local/lib/{libportmidi.dylib, libportmidi_s.a, libpmjni.dylib}\r
60 \r
61 You should now make the pmdefaults.app:\r
62 \r
63 make -f pm_mac/Makefile.osx pmdefaults\r
64 \r
65 NOTE: pmdefaults.app will be in pm_mac/Release/. \r
66 \r
67 Please copy pmdefaults.app to your Applications folder or wherever \r
68 you would normally expect to find it.\r
69 \r
70 ==== USING CMAKE TO BUILD Xcode PROJECT ====\r
71 \r
72 Before you can use Xcode, you need a portmidi.xcodeproj file.\r
73 CMake builds a location-dependent Xcode project, so unfortunately\r
74 it is not easy to provide an Xcode project that is ready to use.\r
75 Therefore, you should make your own. Once you have it, you can\r
76 use it almost like any other Xcode project, and you will not have\r
77 to go back to CMake.\r
78 \r
79 (1) Install CMake if you do not have it already.\r
80 \r
81 (2) Open portmedia/portmidi/CMakeLists.txt with CMake\r
82 \r
83 (3) Use Configure and Generate buttons\r
84 \r
85 (4) This creates portmedia/portmidi/portmidi.xcodeproj.\r
86 \r
87 Note: You will also use pm_mac/pm_mac.xcodeproj, which\r
88 is not generated by CMake.\r
89 \r
90 (5) Open portmidi/portmidi.xcodeproj with Xcode and \r
91 build what you need. The simplest thing is to build the\r
92 ALL_BUILD target. The default will be to build the Debug\r
93 version, but you may want to change this to Release. \r
94 \r
95 NOTE: ALL_BUILD may report errors. Try simply building again\r
96 or rebuilding specific targets that fail until they build\r
97 without errors. There appears to be a race condition or\r
98 missing dependencies in the build system.\r
99 \r
100 The Debug version is compiled with PM_CHECK_ERRORS, and the\r
101 Release version is not. PM_CHECK_ERRORS will print an error\r
102 message and exit your program if any error is returned from\r
103 a call into PortMidi.\r
104 \r
105 CMake (currently) also creates MinSizRel and RelWithDebInfo\r
106 versions, but only because I cannot figure out how to disable\r
107 them.\r
108 \r
109 You will probably want the application PmDefaults, which sets\r
110 default MIDI In and Out devices for PortMidi. You may also\r
111 want to build a Java application using PortMidi. Since I have\r
112 not figured out how to use CMake to make an OS X Java application,\r
113 use pm_mac/pm_mac.xcodeproj as follows:\r
114 \r
115 (6) open pm_mac/pm_mac.xcodeproj\r
116 \r
117 (7) pm_java/pmjni/portmidi_JportmidiApi.h is needed\r
118 by libpmjni.jnilib, the Java native interface library. Since\r
119 portmidi_JportmidiApi.h is included with PortMidi, you can skip\r
120 to step 8, but if you really want to rebuild everything from \r
121 scratch, build the JPortMidiHeaders project first, and continue\r
122 with step 8:\r
123 \r
124 (8) If you did not build libpmjni.dylib using portmidi.xcodeproj,\r
125 do it now. (It depends on portmidi_JportmidiApi.h, and the \r
126 PmDefaults project depends on libpmjni.dylib.)\r
127 \r
128 (9) Returning to pm_mac.xcodeproj, build the PmDefaults program.\r
129 \r
130 (10) If you wish, copy pm_mac/build/Deployment/PmDefaults.app to\r
131 your applications folder.\r
132 \r
133 (11) If you want to install libportmidi.dylib, first make it with \r
134 Xcode, then\r
135     sudo make -f pm_mac/Makefile.osx install\r
136 This command will install /usr/local/include/{porttime.h, portmidi.h} \r
137 and /usr/local/lib/libportmidi.dylib\r
138 Note that the "install" function of xcode creates portmidi/Release\r
139 and does not install the library to /usr/local/lib, so please use\r
140 the command line installer.\r
141 \r
142 \r
143 CHANGELOG\r
144 \r
145 20-Sep-2010 Roger B. Dannenberg\r
146     Adapted to Xcode 3.2.4\r
147 20-Nov-2009 Roger B. Dannenberg\r
148     Added some install instructions\r
149 26-Sep-2009 Roger B. Dannenberg\r
150     More changes for using CMake, Makefiles, XCode\r
151 20-Sep-2009 Roger B. Dannenberg\r
152     Modifications for using CMake\r
153 14-Sep-2009 Roger B. Dannenberg\r
154     Modifications for using CMake\r
155 17-Jan-2007 Roger B. Dannenberg\r
156     Explicit instructions for Xcode\r
157 15-Jan-2007 Roger B. Dannenberg\r
158     Changed instructions because of changes to Makefile.osx\r
159 07-Oct-2006 Roger B. Dannenberg\r
160     Added directions for xcodebuild\r
161 29-aug-2006 Roger B. Dannenberg\r
162     Updated this documentation.\r
163  \r