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