Skip to content

Commit

Permalink
cmake: relax dependencies when using pkg-config
Browse files Browse the repository at this point in the history
we can relax the target dependency checks when using pkg-config to
resolve gstreamer depenedencies, as pkg-config should resolve those
dependencies.

Task-number: QTBUG-127484
Pick-to: 6.5 6.7 6.8
Change-Id: I6ab950fa0b78a25eb690a62337cc6ff49849410a
Reviewed-by: Jøger Hansegård <[email protected]>
  • Loading branch information
timblechmann committed Jul 26, 2024
1 parent 05483f3 commit a6d8e89
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmake/FindGStreamer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ function(find_gstreamer_component component)

set(target GStreamer::${component})

foreach(dependency IN LISTS ARGS_DEPENDENCIES)
if (NOT TARGET ${dependency})
set(GStreamer_${component}_FOUND FALSE PARENT_SCOPE)
return()
endif()
endforeach()

if(NOT TARGET ${target})
string(TOUPPER ${component} upper)
pkg_check_modules(PC_GSTREAMER_${upper} IMPORTED_TARGET ${pkgconfig_name} )
if(TARGET PkgConfig::PC_GSTREAMER_${upper})
add_library(GStreamer::${component} INTERFACE IMPORTED)
target_link_libraries(GStreamer::${component} INTERFACE PkgConfig::PC_GSTREAMER_${upper})
else()
foreach(dependency IN LISTS ARGS_DEPENDENCIES)
if (NOT TARGET ${dependency})
set(GStreamer_${component}_FOUND FALSE PARENT_SCOPE)
return()
endif()
endforeach()

find_path(GStreamer_${component}_INCLUDE_DIR
NAMES ${header}
PATH_SUFFIXES gstreamer-1.0
Expand Down

0 comments on commit a6d8e89

Please sign in to comment.