Skip to content

Commit 71a0647

Browse files
bluetooth audio: fix cmake warning
1 parent 9ddd6a7 commit 71a0647

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Source/bluetooth/audio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ target_link_libraries(${TARGET}
6060
CompileSettingsDebug::CompileSettingsDebug
6161
${NAMESPACE}Core::${NAMESPACE}Core
6262
${NAMESPACE}Messaging::${NAMESPACE}Messaging
63-
${SBC_LIBRARIES}
63+
SBC::SBC
6464
)
6565

6666
set_target_properties(${TARGET}

Source/bluetooth/audio/cmake/FindSBC.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
# SBC_LIBRARIES - The libraries needed to use libsbc
2323

2424
find_package(PkgConfig)
25-
pkg_check_modules(SBC REQUIRED sbc)
25+
pkg_check_modules(SBC REQUIRED sbc IMPORTED_TARGET)
2626

2727
include(FindPackageHandleStandardArgs)
28-
find_package_handle_standard_args(sbc DEFAULT_MSG SBC_LIBRARIES SBC_INCLUDE_DIRS)
28+
find_package_handle_standard_args(SBC DEFAULT_MSG SBC_LIBRARIES SBC_INCLUDE_DIRS)
2929

3030
mark_as_advanced(SBC_FOUND SBC_LIBRARIES SBC_INCLUDE_DIRS)
3131

32+
if(SBC_FOUND)
33+
add_library(SBC::SBC ALIAS PkgConfig::SBC)
34+
endif()

0 commit comments

Comments
 (0)