From 729ac8871142077921fc62a97599fdb11d40e9f8 Mon Sep 17 00:00:00 2001 From: Holden Date: Fri, 20 Sep 2024 04:02:30 -0400 Subject: [PATCH] CMake: Minor Video Cmake Fixes --- cmake/FindGStreamer.cmake | 8 +++++++- .../GStreamer/gstqml6gl/CMakeLists.txt | 19 +------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/cmake/FindGStreamer.cmake b/cmake/FindGStreamer.cmake index 70507567bdd7..ec5d9462dff6 100644 --- a/cmake/FindGStreamer.cmake +++ b/cmake/FindGStreamer.cmake @@ -49,7 +49,8 @@ if(WIN32) else() set(GSTREAMER_PREFIX "C:/gstreamer/1.0/msvc_x86_64") endif() - set(PKG_CONFIG_EXECUTABLE ${GSTREAMER_PREFIX}/bin/pkg-config.exe) + find_program(PKG_CONFIG_PROGRAM pkg-config PATHS ${GSTREAMER_PREFIX}/bin) + set(PKG_CONFIG_EXECUTABLE ${PKG_CONFIG_PROGRAM}) set(ENV{PKG_CONFIG_PATH} "${GSTREAMER_PREFIX}/lib/pkgconfig;${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig;$ENV{PKG_CONFIG_PATH}") # cmake_path(CONVERT "${GSTREAMER_PREFIX}/lib/pkgconfig;${GSTREAMER_PREFIX}/lib/gstreamer-1.0/pkgconfig;$ENV{PKG_CONFIG_PATH}" TO_NATIVE_PATH_LIST PKG_CONFIG_PATH NORMALIZE) # cmake_print_variables(PKG_CONFIG_PATH) @@ -116,6 +117,11 @@ elseif(ANDROID) --define-variable=includedir=${GSTREAMER_PREFIX}/include ) cmake_print_variables(PKG_CONFIG_ARGN) + + if(CMAKE_HOST_WIN32) + find_program(PKG_CONFIG_PROGRAM pkg-config PATHS ${GSTREAMER_PREFIX}/share/gst-android/ndk-build/tools/windows) + set(PKG_CONFIG_EXECUTABLE ${PKG_CONFIG_PROGRAM}) + endif() endif() cmake_print_variables(GSTREAMER_PREFIX) list(PREPEND CMAKE_PREFIX_PATH ${GSTREAMER_PREFIX}) diff --git a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt index 07c94e57911f..6ba34ed5890e 100644 --- a/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt +++ b/src/VideoManager/VideoReceiver/GStreamer/gstqml6gl/CMakeLists.txt @@ -220,8 +220,8 @@ if(NOT GST_PLUGINS_FOUND) ${GSTREAMER_PREFIX}/Versions/Current/lib ${GSTREAMER_PREFIX}/Versions/Current/lib/gstreamer-1.0 ) - cmake_print_variables(GStreamer_${plugin}_LIBRARY) if(GStreamer_${plugin}_LIBRARY) + cmake_print_variables(GStreamer_${plugin}_LIBRARY) target_link_libraries(gstqml6gl PUBLIC ${GStreamer_${plugin}_LIBRARY}) if(WIN32) # install(FILES ${GStreamer_${plugin}_LIBRARY} DESTINATION ${CMAKE_INSTALL_BINDIR}) @@ -305,20 +305,3 @@ if(WIN32) file(GLOB GST_WIN_PLUGINS ${GST_WIN_PLUGINS_PATH}) install(FILES ${GST_WIN_PLUGINS} DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() - -# if(ANDROID) - # configure_file( - # ${GSTREAMER_PREFIX}/share/gst-android/ndk-build/gstreamer_android-1.0.c.in - # ${CMAKE_BINARY_DIR}/gstreamer_android-1.0.c - # @ONLY - # ) - # target_sources(gstqml6gl PRIVATE ${CMAKE_BINARY_DIR}/gstreamer_android-1.0.c) - # install( - # DIRECTORY ${GSTREAMER_PREFIX}/share/gst-android/ndk-build/androidmedia - # DESTINATION ${CMAKE_SOURCE_DIR}/android/src/org/freedesktop/gstreamer/androidmedia - # ) - # install( - # FILES ${GSTREAMER_PREFIX}/share/gst-android/ndk-build/GStreamer.java - # DESTINATION ${CMAKE_SOURCE_DIR}/android/src/org/freedesktop/gstreamer/androidmedia/GStreamer.java - # ) -# endif()