From 26bebba8dd14ccf4178963c3fad998038e9d8b5f Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Mon, 13 Jan 2020 03:08:45 +0100 Subject: [PATCH] fix opus library linking in cmake Signed-off-by: Marcus Llewellyn --- cmake/macros/TargetOpus.cmake | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cmake/macros/TargetOpus.cmake b/cmake/macros/TargetOpus.cmake index eb72deed6a..a8faf5139e 100644 --- a/cmake/macros/TargetOpus.cmake +++ b/cmake/macros/TargetOpus.cmake @@ -5,14 +5,9 @@ # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # -macro(TARGET_OPUS) - if (ANDROID) - # no idea if this is correct - target_link_libraries(${TARGET_NAME}) - else() - # using VCPKG for opus - find_package(OPUS REQUIRED) - target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${OPUS_INCLUDE_DIRS}) - target_link_libraries(${TARGET_NAME} ${OPUS_LIBRARIES}) - endif() +macro(TARGET_opus) + find_library(OPUS_LIBRARY_RELEASE NAMES opus PATHS ${VCPKG_INSTALL_ROOT}/lib) + find_library(OPUS_LIBRARY_DEBUG NAMES opus PATHS ${VCPKG_INSTALL_ROOT}/debug/lib) + select_library_configurations(OPUS) + target_link_libraries(${TARGET_NAME} ${OPUS_LIBRARY}) endmacro()