Skip to content

Commit

Permalink
FindPortMidi: Link ALSA in static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Nov 12, 2023
1 parent 30bca40 commit fde1627
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake/modules/FindPortMidi.cmake
Expand Up @@ -37,6 +37,8 @@ The following cache variables may also be set:

#]=======================================================================]

include(IsStaticLibrary)

find_path(PortMidi_INCLUDE_DIR
NAMES portmidi.h
PATH_SUFFIXES portmidi
Expand Down Expand Up @@ -80,4 +82,14 @@ if(PortMidi_FOUND)
list(APPEND PortMidi_LIBRARIES ${PortTime_LIBRARY})
endif()
set(PortMidi_INCLUDE_DIRS ${PortMidi_INCLUDE_DIR} ${PortTime_INCLUDE_DIR})

is_static_library(PortMidi_IS_STATIC PortMidi::portmidi)
if(PortMidi_IS_STATIC)
find_package(ALSA)
if(ALSA_FOUND)
set_property(TARGET PortMidi::portmidi APPEND PROPERTY INTERFACE_LINK_LIBRARIES
ALSA::ALSA
)
endif()
endif()
endif()

0 comments on commit fde1627

Please sign in to comment.