PortMidi / portmidi

portmidi is a cross-platform MIDI input/output library
Other
116 stars 31 forks source link

Don't link to macOS frameworks with an absolute path #56

Closed daschuer closed 11 months ago

daschuer commented 11 months ago

portmidi suffers from https://github.com/microsoft/vcpkg/issues/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.

rbdannenberg commented 11 months ago

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.

daschuer commented 11 months ago

Thank you. I am currently preparing a test CI run that shows the issue and tests the fix.