Files
tdesktop/cmake/external/opus/CMakeLists.txt
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

55 lines
1.7 KiB
CMake

# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_opus INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
find_package(Opus QUIET)
if (Opus_FOUND)
target_link_libraries(external_opus INTERFACE Opus::opus)
return()
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(DESKTOP_APP_OPUS IMPORTED_TARGET opus)
target_link_libraries(external_opus INTERFACE PkgConfig::DESKTOP_APP_OPUS)
return()
endif()
add_library(external_opus STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
if (WIN32)
target_include_directories(external_opus SYSTEM
INTERFACE
${libs_loc}/opus/include
)
set(opus_lib_loc ${libs_loc}/opus/out)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION "${opus_lib_loc}/Release/opus.lib"
IMPORTED_LOCATION_DEBUG "${opus_lib_loc}/Debug/opus.lib"
)
elseif (APPLE)
target_include_directories(external_opus SYSTEM
INTERFACE
${libs_loc}/local/include/opus
)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION ${libs_loc}/local/lib/libopus.a
)
else()
target_include_directories(external_opus SYSTEM
INTERFACE
/usr/local/include/opus
)
find_library(DESKTOP_APP_OPUS_LIBRARIES libopus.a REQUIRED)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION "${DESKTOP_APP_OPUS_LIBRARIES}"
)
endif()