mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Add a find_package fallback for the *system* libs
This is required, as PortMidi does not have package config available
This commit is contained in:
parent
aae3627476
commit
b25e3b767f
@ -177,7 +177,8 @@ addlib( libvorbis vorbis LIBVORBIS NO YES "vorbis >= 1.3.3"
|
||||
addlib( libflac flac LIBFLAC NO YES "flac >= 1.3.1" "flac++ >= 1.3.1" )
|
||||
addlib( lv2 lv2 LV2 NO YES "lilv-0 >= 0.24.6" "lv2 >= 1.16.0" "serd-0 >= 0.30.2" "sord-0 >= 0.16.4" "sratom-0 >= 0.6.4" "suil-0 >= 0.10.6" )
|
||||
|
||||
addlib( portmidi midi MIDI NO YES "portmidi >= 0.1" )
|
||||
addlib( portmidi midi MIDI NO YES "PortMidi" )
|
||||
|
||||
if (NOT USE_MIDI AND
|
||||
"EXPERIMENTAL_MIDI_OUT" IN_LIST EXPERIMENTAL_OPTIONS_LIST )
|
||||
message(FATAL_ERROR "EXPERIMENTAL_MIDI_OUT requires USE_MIDI")
|
||||
|
@ -655,11 +655,21 @@ function( addlib dir name symbol required check )
|
||||
# And add it to our target
|
||||
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
|
||||
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
|
||||
elseif( ${_OPT}obey_system_dependencies )
|
||||
message( FATAL_ERROR "Failed to find the system package ${name}" )
|
||||
else()
|
||||
set( ${use} "local" )
|
||||
set_property( CACHE ${use} PROPERTY VALUE "local" )
|
||||
find_package( ${packages} QUIET )
|
||||
|
||||
if( TARGET ${TARGET} )
|
||||
set( PKG_${TARGET}_FOUND Yes )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( NOT PKG_${TARGET}_FOUND )
|
||||
if( ${_OPT}obey_system_dependencies )
|
||||
message( FATAL_ERROR "Failed to find the system package ${name}" )
|
||||
else()
|
||||
set( ${use} "local" )
|
||||
set_property( CACHE ${use} PROPERTY VALUE "local" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
31
cmake-proxies/cmake-modules/FindPortMidi.cmake
Normal file
31
cmake-proxies/cmake-modules/FindPortMidi.cmake
Normal file
@ -0,0 +1,31 @@
|
||||
#[[
|
||||
A module to look for PortMidi
|
||||
]]
|
||||
|
||||
if( NOT PortMidi_FOUND )
|
||||
find_path( PortMidi_INCLUDE_DIR portmidi.h )
|
||||
find_library( PortMidi_LIBRARIES NAMES portmidi )
|
||||
|
||||
if( PortMidi_INCLUDE_DIR AND PortMidi_LIBRARIES )
|
||||
set( PortMidi_FOUND Yes )
|
||||
endif()
|
||||
|
||||
if( PortMidi_FOUND )
|
||||
if( NOT PortMidi_FIND_QUIETLY )
|
||||
message( STATUS "Found PortMidi: \n\tPortMidi_INCLUDE_DIR: ${PortMidi_INCLUDE_DIR}\n\tPortMidi_LIBRARIES: ${PortMidi_LIBRARIES}" )
|
||||
endif()
|
||||
|
||||
if( NOT TARGET PortMidi::PortMidi )
|
||||
add_library( PortMidi::PortMidi INTERFACE IMPORTED GLOBAL)
|
||||
|
||||
target_include_directories( PortMidi::PortMidi INTERFACE ${PortMidi_INCLUDE_DIR} )
|
||||
target_link_libraries( PortMidi::PortMidi INTERFACE ${PortMidi_LIBRARIES} )
|
||||
|
||||
add_library(portmidi ALIAS PortMidi::PortMidi)
|
||||
endif()
|
||||
else()
|
||||
if( PortMidi_FIND_REQUIRED )
|
||||
message( FATAL_ERROR "Could not find PortMidi")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user