aboutsummaryrefslogtreecommitdiff
path: root/portmidi/pm_mac/README_MAC.txt
diff options
context:
space:
mode:
Diffstat (limited to 'portmidi/pm_mac/README_MAC.txt')
-rw-r--r--portmidi/pm_mac/README_MAC.txt65
1 files changed, 65 insertions, 0 deletions
diff --git a/portmidi/pm_mac/README_MAC.txt b/portmidi/pm_mac/README_MAC.txt
new file mode 100644
index 0000000..41e8341
--- /dev/null
+++ b/portmidi/pm_mac/README_MAC.txt
@@ -0,0 +1,65 @@
1README_MAC.txt for PortMidi
2Roger Dannenberg
320 nov 2009
4
5revised Mar 2024 to remove pmdefaults references
6revised Jan 2022 for the PortMidi/portmidi repo on github.com
7revised 20 Sep 2010 for Xcode 4.3.2 and CMake 2.8.8
8
9This documents how I build PortMidi for macOS. It's not the only way,
10and command-line/scripting enthusiasts will say it's not even a good
11way. Feel free to contribute your approach if you are willing to
12describe it carefully and test it.
13
14Install Xcode and the CMake application, CMake.app. I use the GUI
15version of CMake which makes it easy to see/edit variables and
16options.
17
18==== USING CMAKE ====
19
20Run CMake.app and select your portmidi repo working directory as the
21location for source and build. (Yes, I use so called "in-tree"
22builds -- it doesn't hurt, but I don't think it is necessary.)
23
24Default settings should all be fine, but select options under BUILD if
25you wish:
26
27BUILD_NATIVE_JAVA_INTERFACE to build a Java interface (JNI) library.
28
29BUILD_PORTMIDI_TESTS to create some test programs. Of particular
30interest are test/mm, a handy command-line MIDI Input Monitor, and
31test/testio, a simple command-line program to send or receive some
32MIDI notes in case you need a quick test: What devices do I have? Does
33this input work? Does this output work?
34
35I disable BUILD_SHARED_LIBS and always link statically: Static linking only
36adds about 40KB to any application and then you don't have to worry
37about versions, instally, copying or finding the dynamic link library,
38etc.
39
40To make sure you link statically, I rename the library to
41libportmidi_static.a. To do this, set PM_STATIC_LIB_NAME (in CMake,
42under the "PM" group) to "portmidi_static", and of course your
43application will have to specify portmidi_static as the library to
44link to.
45
46If you are building simple command-line applications, you might want
47to enable PM_CHECK_ERRORS. If you do, then calls into the PortMidi
48library will print error messages and exit in the event of an error
49(such as trying to open a device that does not exist). This saves you
50from having to check for errors everytime you call a library function
51or getting confused when errors are detected but not reported. For
52high-quality applications, do NOT enable PM_CHECK_ERRORS -- any
53failure could immediately abort your whole application, which is not
54very friendly to users.
55
56Click on Configure (maybe a couple of times).
57
58Click on Generate and make an Xcode project.
59
60Open portmidi/portmidi.xcodeproj with Xcode and build what you
61need. The simplest thing is to build the ALL_BUILD target. Be careful
62to specify a Debug or Release depending on what you want. "ALL_BUILD"
63is a misnomer -- it only builds the version you select.
64
65