Skip to content

Commit

Permalink
Merge pull request #668 from ferdnyc/deps-reduction
Browse files Browse the repository at this point in the history
Reduce dependencies by eliminating unnecessary components
  • Loading branch information
ferdnyc committed Apr 29, 2021
2 parents 3d804c4 + 1f05c5f commit aa57219
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/CMakeLists.txt
Expand Up @@ -184,7 +184,7 @@ target_link_libraries(openshot PUBLIC OpenShot::Audio)
###

# Find the ImageMagick++ library
find_package(ImageMagick COMPONENTS Magick++ MagickWand MagickCore)
find_package(ImageMagick COMPONENTS Magick++ MagickCore)

if(ImageMagick_FOUND)
if(NOT TARGET ImageMagick::Magick++ AND NOT TARGET Magick++_TARGET)
Expand Down Expand Up @@ -246,10 +246,12 @@ endif ()
if (NOT jsoncpp_FOUND AND NOT DISABLE_BUNDLED_JSONCPP)
message(STATUS "Using embedded jsoncpp (not found or USE_SYSTEM_JSONCPP disabled)")
if (NOT TARGET jsoncpp_lib)
add_library(jsoncpp_lib INTERFACE)
target_include_directories(jsoncpp_lib INTERFACE
add_library(jsoncpp_lib OBJECT)
set_target_properties(jsoncpp_lib PROPERTIES
POSITION_INDEPENDENT_CODE TRUE)
target_include_directories(jsoncpp_lib PUBLIC
"${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp")
target_sources(jsoncpp_lib INTERFACE "${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/jsoncpp.cpp")
target_sources(jsoncpp_lib PRIVATE "${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/jsoncpp.cpp")
# Because this satisfies the requirement, an installed JsonCpp is optional
set_package_properties(jsoncpp PROPERTIES TYPE OPTIONAL)
endif ()
Expand Down Expand Up @@ -284,9 +286,14 @@ mark_as_advanced(QT_VERSION_STR)

################### FFMPEG #####################
# Find FFmpeg libraries (used for video encoding / decoding)
find_package(FFmpeg REQUIRED COMPONENTS avcodec avdevice avformat avutil swscale)
find_package(FFmpeg REQUIRED COMPONENTS avcodec avformat avutil swscale)

set(all_comps avcodec avdevice avformat avfilter avutil postproc swscale swresample avresample)
set(all_comps avcodec avformat avutil swscale)
if(TARGET FFmpeg::swresample)
list(APPEND all_comps swresample)
else()
list(APPEND all_comps avresample)
endif()
set(version_comps avcodec avformat avutil)

foreach(ff_comp IN LISTS all_comps)
Expand Down

0 comments on commit aa57219

Please sign in to comment.