Add support for the use of CM108 for PTT on Mac #500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes implement support for PTT using CM108 on a Mac. A few notes:
The actual code is exactly the same as for Windows, using the hidapi API, so the changes are little more than updated #if conditions.
The CMake changes are slightly complicated by the Windows build using a local copy of some hidapi files, for some reason, instead of using the library itself. The Mac version uses hidapi in the same way as other libraries.
In the CMake files, it is unclear to me whether "elseif (NOT WIN32 AND NOT CYGWIN)" means the same thing as "elseif (APPLE)", so they are treated separately in order to avoid breaking other build types.
The generic config file has been simplified slightly, since the section on using CM108 for PTT is now common to all of Linux, Windows and Mac.
The README has been updated to include a build section for Mac.
These changes have been verified on macOS Ventura 13.6 (Apple M2 silicon) and macOS High Sierra 10.13.6 (Intel), as well as on Linux Mint 20.3 to verify that nothing was broken. I do not have a Windows system to test with.