1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01: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:
Dmitry Vedenko
2021-07-30 18:44:09 +03:00
committed by Dmitry Vedenko
parent aae3627476
commit b25e3b767f
3 changed files with 47 additions and 5 deletions

View File

@@ -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()