cmake find_package(..) what is the proper gstreamer package name?

Rick Blacker rick_blacker at hotmail.com
Thu Oct 27 06:06:17 UTC 2016


Guys, I'm sorry, I know this may be second hand to some, and I'm trying to read up on this stuff, but for some reason it's not clicking very easily for me. (yes, I came from a Microsoft Visual Studio world)



Here is the path to my QT project where I'm trying to use CMake. This directory has one source code file. main.cpp
    ~/dev/qt_workspace/InitGStreamer$

My QT build folder is here
    ~/dev/qt_workspace/InitGStreamer/build-InitGStreamer-Desktop_Qt_5_7_0_GCC_64bit-Default$

Then I created a sub directory structure under it. I got this structure from reading the CMake docs.  https://cmake.org/Wiki/CMake:How_To_Find_Libraries
    ~/dev/qt_workspace/InitGStreamer/cmake/Modules$

In in there is a file called FindGStreamer.cmake which I found here
    https://raw.githubusercontent.com/WebKit/webkit/master/Source/cmake/FindGStreamer.cmake

Here is what I have done in my cmake file.

    cmake_minimum_required(VERSION 2.8)
    project(InitGStreamer)
    add_executable(${PROJECT_NAME} main.cpp )
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
    find_package(gstreamer-app REQUIRED)


However, I'm getting the following output error from CMake.

    Running "/usr/bin/cmake /home/rick/dev/qt_workspace/InitGStreamer '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DQT_QMAKE_EXECUTABLE:STRING=/home/rick/DevApps/Qt/5.7/gcc_64/bin/qmake" in /home/rick/dev/qt_workspace
    /InitGStreamer/build-InitGStreamer-Desktop_Qt_5_7_0_GCC_64bit-Default.

    -- Configuring incomplete, errors occurred!

    See also "/home/rick/dev/qt_workspace/InitGStreamer/build-InitGStreamer-Desktop_Qt_5_7_0_GCC_64bit-Default/CMakeFiles/CMakeOutput.log".

    CMake Error at CMakeLists.txt:5 (find_package):

    By not providing "Findgstreamer-app.cmake" in CMAKE_MODULE_PATH this

    project has asked CMake to find a package configuration file provided by

    "gstreamer-app", but CMake did not find one.


    Could not find a package configuration file provided by "gstreamer-app"

    with any of the following names:


    gstreamer-appConfig.cmake

    gstreamer-app-config.cmake


    Add the installation prefix of "gstreamer-app" to CMAKE_PREFIX_PATH or set

    "gstreamer-app_DIR" to a directory containing one of the above files. If

    "gstreamer-app" provides a separate development package or SDK, be sure it

    has been installed.


    *** cmake process exited with exit code 1.

THEN I changed my CMake to this.
    cmake_minimum_required(VERSION 2.8)
    project(InitGStreamer)
    add_executable(${PROJECT_NAME} main.cpp )
    include("${CMAKE_SOURCE_DIR}/cmake/Modules/FindGStreamer.cmake")
    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
    #find_package(gstreamer-app REQUIRED)
    find_package(PkgConfig)
    #aux_source_directory(. SRC_LIST)
    #add_executable(${PROJECT_NAME} ${SRC_LIST})

    include_directories( ${GSTREAMER_INCLUDE_DIR})
    add_definitions(${GSTREAMER_DEFINITIONS})
    #target_link_libraries(MPEG4GStreamer ${GSTREAMER_LIBRARIES})

This seemed to do something... I didn't get any errors, but when I went back to my source code file in QT Creator, it still could not find #include <gst/gst.h>.
Am I wrong to assume that QT Creator will resolve the where this header is automatically based on the cmake setup I have?





On 10/26/2016 11:32 AM, Nicolas Dufresne wrote:

Le mercredi 26 octobre 2016 à 17:56 +0000, Rick Blacker a écrit :


I’m new to both GStreamer and CMake.  I’m trying to create a cmake
file for an app that I want to use gstreamer in. When I use the
command
find_package( …. )  I’ve tried several different gstreamer package
names.  Things like find_package( gstreamer-1.0 ) and others.  None
of them worked.

Does anyone know the proper value to use here?



GStreamer implement standard pkg-config metadata. CMake provides the
PkgConfig package to let you interface with that. Here's an exemple:

find_package(PkgConfig)

pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.4
                               gstreamer-sdp-1.0>=1.4
                               gstreamer-video-1.0>=1.4
                               gstreamer-app-1.0>=1.4)

Notice that GStreamer is a collection of libraries. The list will
depend on your application needs. From there you'll have to update few
things. Globally, link_directories with ${GST_LIBRARY_DIRS} (only
needed if you use GStreamer from non-system installation). And per
target:
 - target_include_directories with ${GST_INCLUDE_DIRS}
 - target_compile_options with ${GST_CFLAGS}
 - target_link_libraries with ${GST_LIBRARIES}

You'll also have to choose between private and public exposure
depending if you create an app or library and if you expose GStreamer
through your library or not.

cheers,
Nicolas
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161027/2d7ed78e/attachment.html>


More information about the gstreamer-devel mailing list