1
0
Fork 0

Fix opus linking with ffmpeg

This commit is contained in:
Ilya Fedin 2020-07-23 03:54:18 +04:00 committed by John Preston
parent f0150997cb
commit 25070e1b04
2 changed files with 38 additions and 38 deletions

View file

@ -59,7 +59,7 @@ else()
${ffmpeg_lib_loc}/libswresample/libswresample.a
${ffmpeg_lib_loc}/libswscale/libswscale.a
${ffmpeg_lib_loc}/libavutil/libavutil.a
desktop-app::external_opus
$<TARGET_FILE:desktop-app::external_opus>
)
if (LINUX)
target_link_static_libraries(external_ffmpeg

View file

@ -4,49 +4,49 @@
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_opus INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
if (NOT DESKTOP_APP_USE_PACKAGED)
target_include_directories(external_opus SYSTEM
INTERFACE
${libs_loc}/opus/include
)
endif()
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_opus INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPUS IMPORTED_TARGET opus)
target_link_libraries(external_opus INTERFACE PkgConfig::OPUS)
elseif (WIN32)
set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/Win32/$<IF:$<CONFIG:Debug>,Debug,Release>)
target_link_libraries(external_opus
INTERFACE
${opus_lib_loc}/opus.lib
)
elseif (APPLE AND NOT build_osx)
target_include_directories(external_opus
INTERFACE
/usr/local/macos/include
)
target_link_libraries(external_opus
INTERFACE
/usr/local/macos/lib/libopus.a
)
elseif (APPLE)
target_include_directories(external_opus
INTERFACE
/usr/local/include
)
target_link_libraries(external_opus
INTERFACE
/usr/local/lib/libopus.a
)
else()
target_link_static_libraries(external_opus
add_library(external_opus STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_opus ALIAS external_opus)
target_include_directories(external_opus SYSTEM
INTERFACE
opus
${libs_loc}/opus/include
)
if (WIN32)
set(opus_lib_loc ${libs_loc}/opus/win32/VS2015/Win32/$<IF:$<CONFIG:Debug>,Debug,Release>)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION "${opus_lib_loc}/opus.lib"
)
elseif (APPLE AND NOT build_osx)
target_include_directories(external_opus
INTERFACE
/usr/local/macos/include
)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION /usr/local/macos/lib/libopus.a
)
elseif (APPLE)
target_include_directories(external_opus
INTERFACE
/usr/local/include
)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION /usr/local/lib/libopus.a
)
else()
find_library(OPUS_LIBRARY libopus.a)
set_target_properties(external_opus PROPERTIES
IMPORTED_LOCATION "${OPUS_LIBRARY}"
)
endif()
endif()