Don't link to macOS frameworks with an absolute path
Closed this issue · 2 comments
portmidi suffers from microsoft/vcpkg#16259
See portmidi/PortMidiTargets.cmake
set_target_properties(PortMidi::portmidi PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreAudio.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreFoundation.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreMIDI.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreServices.framework"
)
This should use "-Wl,-framework,CoreServices" instead.
I'm not a big advocate of installer and package configuration features of CMake. I see the advantages if all libraries and subsystems use CMake consistently, but it's also complex, fragile, and not very stable. I'm happy to include this stuff in Portmidi to the extent others find it useful, but I don't support it, and my recommendation is simply add Portmidi files (a small library) to your project if you need it, or just build a static Portmidi library and link to it. If there's a tested code fix you'd like me to incorporate, let me know.
Thank you. I am currently preparing a test CI run that shows the issue and tests the fix.