Skip to content

Commit

Permalink
Don't use absolut paths to macOS frameworks
Browse files Browse the repository at this point in the history
This fixes PortMidi#56
  • Loading branch information
daschuer authored Jul 27, 2023
1 parent 2655ee5 commit aa375d4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pm_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,24 @@ endif()
# first include the appropriate system-dependent file:
if(UNIX AND APPLE)
set(Threads::Threads "" PARENT_SCOPE)
find_library(COREAUDIO_LIBRARY CoreAudio REQUIRED)
find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
find_library(COREMIDI_LIBRARY CoreMIDI REQUIRED)
find_library(CORESERVICES_LIBRARY CoreServices REQUIRED)
set(PM_LIB_PRIVATE_SRC
${PMDIR}/porttime/ptmacosx_mach.c
${PMDIR}/pm_mac/pmmac.c
${PMDIR}/pm_mac/pmmacosxcm.c)
set(PM_NEEDED_LIBS ${CMAKE_THREAD_LIBS_INIT} ${COREAUDIO_LIBRARY}
${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY}
set(PM_NEEDED_LIBS
${CMAKE_THREAD_LIBS_INIT}
-Wl,-framework,CoreAudio
-Wl,-framework,CoreFoundation
-Wl,-framework,CoreMidi
-Wl,-framework,CoreServices
PARENT_SCOPE)
target_link_libraries(portmidi PRIVATE Threads::Threads ${COREAUDIO_LIBRARY}
${COREFOUNDATION_LIBRARY} ${COREMIDI_LIBRARY} ${CORESERVICES_LIBRARY})
target_link_libraries(portmidi PRIVATE
Threads::Threads
-Wl,-framework,CoreAudio
-Wl,-framework,CoreFoundation
-Wl,-framework,CoreMidi
-Wl,-framework,CoreServices
)
# set to CMake default; is this right?:
set_target_properties(portmidi PROPERTIES MACOSX_RPATH ON)
elseif(HAIKU)
Expand Down

0 comments on commit aa375d4

Please sign in to comment.