CMake: improve finding gstreamer

Support checking for multiple versions, first check gstreamer-1.0, then gstreamer-0.10.
Add support for finding gstreamer-player.
Specify the required components, add the include directories and link with the libraries of the found components.
Set the setup variables wxUSE_GSTREAMER and wxUSE_GSTREAMER_PLAYER.
This commit is contained in:
Maarten Bent
2018-11-04 16:03:59 +01:00
parent 63c602c3d2
commit d293f94d95
3 changed files with 53 additions and 26 deletions

View File

@@ -32,7 +32,26 @@ if(WXOSX_COCOA)
)
elseif(UNIX)
wx_lib_include_directories(media PUBLIC ${GSTREAMER_INCLUDE_DIRS})
if(GSTREAMER_INTERFACES_INCLUDE_DIRS)
wx_lib_include_directories(media PUBLIC ${GSTREAMER_INTERFACES_INCLUDE_DIRS})
endif()
if(GSTREAMER_VIDEO_INCLUDE_DIRS)
wx_lib_include_directories(media PUBLIC ${GSTREAMER_VIDEO_INCLUDE_DIRS})
endif()
if(GSTREAMER_PLAYER_INCLUDE_DIRS)
wx_lib_include_directories(media PUBLIC ${GSTREAMER_PLAYER_INCLUDE_DIRS})
endif()
wx_lib_link_libraries(media PUBLIC ${GSTREAMER_LIBRARIES})
if(GSTREAMER_INTERFACES_LIBRARIES)
wx_lib_link_libraries(media PUBLIC ${GSTREAMER_INTERFACES_LIBRARIES})
endif()
if(GSTREAMER_VIDEO_LIBRARIES)
wx_lib_link_libraries(media PUBLIC ${GSTREAMER_VIDEO_LIBRARIES})
endif()
if(GSTREAMER_PLAYER_LIBRARIES)
wx_lib_link_libraries(media PUBLIC ${GSTREAMER_PLAYER_LIBRARIES})
endif()
endif()
wx_finalize_lib(media)