diff --git a/external/ffmpeg/CMakeLists.txt b/external/ffmpeg/CMakeLists.txt index 4791ecf..c556ce3 100644 --- a/external/ffmpeg/CMakeLists.txt +++ b/external/ffmpeg/CMakeLists.txt @@ -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 + $ ) if (LINUX) target_link_static_libraries(external_ffmpeg diff --git a/external/opus/CMakeLists.txt b/external/opus/CMakeLists.txt index 1774688..2f25ad4 100644 --- a/external/opus/CMakeLists.txt +++ b/external/opus/CMakeLists.txt @@ -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/$,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/$,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()