From 8ca7ff848477ccd8687a5ed0fe3dabf1070f7726 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 17 Apr 2022 07:29:07 +0400 Subject: [PATCH] Don't require breakpad/ffmpeg build directories on Linux --- .../crash_reports/breakpad/CMakeLists.txt | 17 ++++++--- external/ffmpeg/CMakeLists.txt | 36 +++++++++++++------ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/external/crash_reports/breakpad/CMakeLists.txt b/external/crash_reports/breakpad/CMakeLists.txt index d57a17e8..1a36e06e 100644 --- a/external/crash_reports/breakpad/CMakeLists.txt +++ b/external/crash_reports/breakpad/CMakeLists.txt @@ -7,10 +7,19 @@ add_library(external_breakpad INTERFACE IMPORTED GLOBAL) add_library(desktop-app::external_breakpad ALIAS external_breakpad) -target_include_directories(external_breakpad SYSTEM -INTERFACE - ${libs_loc}/breakpad/src -) +if (LINUX) + find_package(PkgConfig REQUIRED) + pkg_check_modules(BREAKPAD REQUIRED breakpad) + target_include_directories(external_breakpad SYSTEM + INTERFACE + ${BREAKPAD_INCLUDE_DIRS} + ) +else() + target_include_directories(external_breakpad SYSTEM + INTERFACE + ${libs_loc}/breakpad/src + ) +endif() if (build_win64) set(breakpad_config_add _x64) diff --git a/external/ffmpeg/CMakeLists.txt b/external/ffmpeg/CMakeLists.txt index 39f0a367..a83053f0 100644 --- a/external/ffmpeg/CMakeLists.txt +++ b/external/ffmpeg/CMakeLists.txt @@ -25,25 +25,41 @@ if (DESKTOP_APP_USE_PACKAGED) PkgConfig::SWRESAMPLE ) else() - target_include_directories(external_ffmpeg SYSTEM - INTERFACE - ${libs_loc}/ffmpeg - ) + if (LINUX) + target_link_static_libraries(external_ffmpeg + INTERFACE + avformat + avcodec + swresample + swscale + avutil + ) + else() + set(ffmpeg_lib_loc ${libs_loc}/ffmpeg) - set(ffmpeg_lib_loc ${libs_loc}/ffmpeg) + target_include_directories(external_ffmpeg SYSTEM + INTERFACE + ${ffmpeg_lib_loc} + ) + + target_link_libraries(external_ffmpeg + INTERFACE + ${ffmpeg_lib_loc}/libavformat/libavformat.a + ${ffmpeg_lib_loc}/libavcodec/libavcodec.a + ${ffmpeg_lib_loc}/libswresample/libswresample.a + ${ffmpeg_lib_loc}/libswscale/libswscale.a + ${ffmpeg_lib_loc}/libavutil/libavutil.a + ) + endif() target_link_libraries(external_ffmpeg INTERFACE - ${ffmpeg_lib_loc}/libavformat/libavformat.a - ${ffmpeg_lib_loc}/libavcodec/libavcodec.a - ${ffmpeg_lib_loc}/libswresample/libswresample.a - ${ffmpeg_lib_loc}/libswscale/libswscale.a - ${ffmpeg_lib_loc}/libavutil/libavutil.a $ $ $ $ ) + if (APPLE) target_link_libraries(external_ffmpeg INTERFACE bz2) elseif (LINUX)