mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 06:51:17 +01:00
cmake: Add imported target to FindALSA
This commit is contained in:
parent
c3b2039153
commit
d615c0f868
@ -39,7 +39,7 @@ if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
|
|||||||
unset(alsa_version_str)
|
unset(alsa_version_str)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
|
||||||
REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
|
REQUIRED_VARS ALSA_LIBRARY ALSA_INCLUDE_DIR
|
||||||
VERSION_VAR ALSA_VERSION_STRING)
|
VERSION_VAR ALSA_VERSION_STRING)
|
||||||
@ -47,6 +47,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA
|
|||||||
if(ALSA_FOUND)
|
if(ALSA_FOUND)
|
||||||
set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
|
set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
|
||||||
set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
|
set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
|
||||||
|
add_library(ALSA::ALSA UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(ALSA::ALSA PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${ALSA_LIBRARY}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)
|
mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)
|
||||||
|
@ -15,9 +15,10 @@ if(OPENSLES_FOUND)
|
|||||||
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
target_link_libraries(audiocommon PRIVATE OpenSLES::OpenSLES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(ALSA)
|
||||||
if(ALSA_FOUND)
|
if(ALSA_FOUND)
|
||||||
target_sources(audiocommon PRIVATE AlsaSoundStream.cpp)
|
target_sources(audiocommon PRIVATE AlsaSoundStream.cpp)
|
||||||
target_link_libraries(audiocommon PRIVATE ${ALSA_LIBRARIES})
|
target_link_libraries(audiocommon PRIVATE ALSA::ALSA)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(AO_FOUND)
|
if(AO_FOUND)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user