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

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

rick b

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-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Dufresne-4
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

rick b
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

rick b

I take it back.. There is something wrong with the cmake script. When I print out these values,
    message( "found = ${GSTREAMER_FOUND}" )
    message( "dirs = ${GSTREAMER_INCLUDE_DIRS}" )
    message( "libs = ${GSTREAMER_LIBRARIES}" )
    message( "base dir include = ${GSTREAMER_BASE_INCLUDE_DIRS}" )
    message( "base dir libraries = ${GSTREAMER_BASE_LIBRARIES}" )

I get these results

    found = TRUE
    dirs =

    libs = GSTREAMER_LIBRARIES-NOTFOUND

    base dir include =

    base dir libraries = GSTREAMER_BASE_LIBRARIES-NOTFOUND




On 10/26/2016 11:06 PM, Rick Blacker wrote:
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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Dufresne-4
In reply to this post by rick b
Le jeudi 27 octobre 2016 à 06:06 +0000, Rick Blacker a écrit :
    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)

Please, read my previous email. GStreamer do not provide cmake specific package. If one exist, it is most likely out-dated. Use PkgConfig package finder with the rather complete instruction I have provided.

regards,
Nicolas

In case you missed it:
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.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Dufresne-4
In reply to this post by rick b
Le jeudi 27 octobre 2016 à 06:29 +0000, Rick Blacker a écrit :
>     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})

After loading the extension, you need to call function to check package
presence. The library check is done by this line:


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)

The list can be adjusted, the required version too.

Nicolas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

rick b

I have a Cmake that looks like this now.
    cmake_minimum_required(VERSION 2.8)
    project(InitGStreamer)
    add_executable(${PROJECT_NAME} main.cpp )

    find_package(PkgConfig)
    pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.4 )


This is giving me the following error

    Running "/usr/bin/cmake /home/rick/dev/qt_workspace/InitGStreamer '-GCodeBlocks - Unix Makefiles'" in /tmp/qtc-cmake-yMRXIp.
    -- Checking for module 'gstreamer-1.0>=1.4'
    --
    CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
    A required package was not found
    Call Stack (most recent call first):
    /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532 (_pkg_check_modules_internal)
    CMakeLists.txt:8 (pkg_check_modules)


    -- Configuring incomplete, errors occurred!
    See also "/tmp/qtc-cmake-yMRXIp/CMakeFiles/CMakeOutput.log".
    *** cmake process exited with exit code 1.

Even when I remove the >=1.4 part of pkg_check.. I'm still getting the same error.


I am lost, I really have no clue here. I've tried reading the information that's out there, but it does not make sense to me. I don't know if PkgConfig is just a place holder for an actual name of some package, if that is the actual value that needs to be passed in.  I thought I had gstreamer-1.0 installed on my machine. Maybe I don't.

Here is what I get when I search for gstreamer in Synaptic Package Manager and filter on things that are installed.

what is installed

All I'm trying to do here is follow along with the gstreamer documentation so that I can ramp up on gstreamer and use it. Are there examples out there that are very explicit in how to:
1) figure out what version of gstreamer you have installed
2) shows you how to use CMake to compile against an app that is using gstreamer? Rather that is manually creating a cmake file or using the pkg-config options.
3) Lists out exactly what values you need in your cmake file?

Thanks for additional assistance.
Rick






On 10/27/2016 06:31 AM, Nicolas Dufresne wrote:
Le jeudi 27 octobre 2016 à 06:29 +0000, Rick Blacker a écrit :
    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})
After loading the extension, you need to call function to check package
presence. The library check is done by this line:


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)

The list can be adjusted, the required version too.

Nicolas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel