summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--cmake/modules/FindQtGStreamer.cmake24
-rw-r--r--src/CMakeLists.txt231
-rw-r--r--src/QGlib/CMakeLists.txt61
-rw-r--r--src/QGst/CMakeLists.txt145
-rw-r--r--tests/compilation/CMakeLists.txt1
-rw-r--r--tests/compilation/RunCompilationTests.cmake1
7 files changed, 265 insertions, 204 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a227078..18a8789 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,15 +3,12 @@ cmake_minimum_required(VERSION 2.8)
enable_testing()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
-set(BUILDING_QTGSTREAMER TRUE)
-set(QTGSTREAMER_VERSION 0.1)
-set(QTGSTREAMER_SOVERSION 0)
+set(QTGSTREAMER_VERSION 0.10.0)
option(QTGSTREAMER_STATIC "Build QtGStreamer as a static library" ON)
option(QTGSTREAMER_TESTS "Build QtGStreamer's tests" OFF)
option(QTGSTREAMER_EXAMPLES "Build QtGStreamer's examples" ON)
-
include(MacroLogFeature)
find_package(Qt4 COMPONENTS QtCore QtGui QtTest)
@@ -21,6 +18,7 @@ find_package(Boost)
macro_log_feature(Boost_FOUND "Boost" "Required for building QtGLib" "http://www.boost.org/" TRUE "1.40")
# this just sets the QTGSTREAMER_* cmake variables
+set(BUILDING_QTGSTREAMER TRUE)
find_package(QtGStreamer REQUIRED)
find_package(Automoc4)
diff --git a/cmake/modules/FindQtGStreamer.cmake b/cmake/modules/FindQtGStreamer.cmake
index 0f84548..4762089 100644
--- a/cmake/modules/FindQtGStreamer.cmake
+++ b/cmake/modules/FindQtGStreamer.cmake
@@ -4,8 +4,12 @@
# QTGSTREAMER_FOUND - system has QtGStreamer
# QTGSTREAMER_INCLUDE_DIR - the QtGStreamer include directory
# QTGSTREAMER_INCLUDES - the include directories needed to use QtGStreamer
+# QTGLIB_LIBRARY - the QtGLib library
+# QTGLIB_LIBRARIES - the libraries needed to use QtGLib
# QTGSTREAMER_LIBRARY - the QtGStreamer library
# QTGSTREAMER_LIBRARIES - the libraries needed to use QtGStreamer
+# QTGSTREAMER_UI_LIBRARY - the QtGStreamerUi library
+# QTGSTREAMER_UI_LIBRARIES - the libraries needed to use QtGStreamerUi
# QTGSTREAMER_DEFINITIONS - definitions recommended for using QtGStreamer
# QTGSTREAMER_FLAGS - extra compiler switches recommended for using QtGStreamer
#
@@ -25,6 +29,7 @@ endif()
set(_QTGSTREAMER_LINK_TO_QT_REQUIRED FALSE)
if(BUILDING_QTGSTREAMER)
+ set(QTGLIB_LIBRARY QtGLib)
set(QTGSTREAMER_LIBRARY QtGStreamer)
set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi)
set(QTGSTREAMER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src)
@@ -36,19 +41,23 @@ else()
if(NOT _QTGSTREAMER_TARGETS_FILE)
# Targets file not found. Do a typical search for QtGStreamer.
# Normally, this path is never executed. It is just provided as a fallback in case something goes wrong.
- find_library(QTGSTREAMER_LIBRARY QtGStreamer
+ find_library(QTGLIB_LIBRARY QtGLib-2.0
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
- find_library(QTGSTREAMER_UI_LIBRARY QtGStreamerUi
+ find_library(QTGSTREAMER_LIBRARY QtGStreamer-0.10
+ PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
+ find_library(QTGSTREAMER_UI_LIBRARY QtGStreamerUi-0.10
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../lib")
find_path(QTGSTREAMER_INCLUDE_DIR QGst/global.h
PATHS "${_QTGSTREAMER_CONFIG_DIR}/../../include"
PATH_SUFFIXES QtGStreamer)
set(_QTGSTREAMER_LINK_TO_QT_REQUIRED TRUE)
+ mark_as_advanced(QTGLIB_LIBRARY QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY QTGSTREAMER_INCLUDE_DIR)
else()
# Targets file found. Use imported QtGStreamer target and relative include path.
# We assume that this file has been installed in $PREFIX/lib/QtGStreamer/,
# so the include path should evaluate to $PREFIX/include/QtGStreamer
include(${_QTGSTREAMER_TARGETS_FILE})
+ set(QTGLIB_LIBRARY QtGLib)
set(QTGSTREAMER_LIBRARY QtGStreamer)
set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi)
get_filename_component(QTGSTREAMER_INCLUDE_DIR "${_QTGSTREAMER_CONFIG_DIR}/../../include/QtGStreamer" ABSOLUTE)
@@ -56,7 +65,7 @@ else()
endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(QtGStreamer DEFAULT_MSG QTGSTREAMER_INCLUDE_DIR
+find_package_handle_standard_args(QtGStreamer DEFAULT_MSG QTGSTREAMER_INCLUDE_DIR QTGLIB_LIBRARY
QTGSTREAMER_LIBRARY QTGSTREAMER_UI_LIBRARY)
if(QTGSTREAMER_FOUND)
@@ -76,10 +85,11 @@ if(QTGSTREAMER_FOUND)
set(QTGSTREAMER_DEFINITIONS "-DQT_NO_KEYWORDS")
if (_QTGSTREAMER_LINK_TO_QT_REQUIRED)
- set(QTGSTREAMER_LIBRARIES ${QTGSTREAMER_LIBRARY} ${QT_QTCORE_LIBRARY})
- set(QTGSTREAMER_UI_LIBRARIES ${QTGSTREAMER_UI_LIBRARY} ${QTGSTREAMER_LIBRARY}
- ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
+ set(QTGLIB_LIBRARIES ${QTGLIB_LIBRARY} ${QT_QTCORE_LIBRARY})
+ set(QTGSTREAMER_LIBRARIES ${QTGSTREAMER_LIBRARY} ${QTGLIB_LIBRARIES})
+ set(QTGSTREAMER_UI_LIBRARIES ${QTGSTREAMER_UI_LIBRARY} ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARIES})
else()
+ set(QTGLIB_LIBRARIES ${QTGLIB_LIBRARY})
set(QTGSTREAMER_LIBRARIES ${QTGSTREAMER_LIBRARY})
set(QTGSTREAMER_UI_LIBRARIES ${QTGSTREAMER_UI_LIBRARY})
endif()
@@ -103,5 +113,3 @@ if(QTGSTREAMER_FOUND)
endif()
endif()
-
-mark_as_advanced(QTGSTREAMER_LIBRARY QTGSTREAMER_INCLUDE_DIR)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bcf0aa2..3657f92 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,201 +1,48 @@
-set(QtGStreamer_SRCS
- QGlib/quark.cpp
- QGlib/type.cpp
- QGlib/paramspec.cpp
- QGlib/object.cpp
- QGlib/value.cpp
- QGlib/signal.cpp
- QGlib/error.cpp
- QGlib/connect.cpp
- QGlib/wrap.cpp
- QGlib/init.cpp
+# Common variables
+set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+set(INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/QtGStreamer)
+set(EXPORT_TARGET_SET QtGStreamerTargets)
- QGst/global.cpp
- QGst/objectstore.cpp
- QGst/value.cpp
- QGst/structure.cpp
- QGst/caps.cpp
- QGst/miniobject.cpp
- QGst/object.cpp
- QGst/pad.cpp
- QGst/ghostpad.cpp
- QGst/element.cpp
- QGst/pluginfeature.cpp
- QGst/elementfactory.cpp
- QGst/bin.cpp
- QGst/childproxy.cpp
- QGst/pipeline.cpp
- QGst/message.cpp
- QGst/bus.cpp
- QGst/parse.cpp
- QGst/urihandler.cpp
- QGst/videoorientation.cpp
- QGst/xoverlay.cpp
- QGst/streamvolume.cpp
- QGst/colorbalance.cpp
- QGst/propertyprobe.cpp
- QGst/query.cpp
- QGst/clock.cpp
- QGst/buffer.cpp
- QGst/event.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
-)
-
-set(QtGStreamerUi_SRCS
- QGst/Ui/videowidget.cpp
-)
-
-set(INSTALLED_HEADERS
- QGlib/global.h
- QGlib/quark.h QGlib/Quark
- QGlib/type.h QGlib/Type
- QGlib/refpointer.h QGlib/RefPointer
- QGlib/wrap.h
- QGlib/paramspec.h QGlib/ParamSpec
- QGlib/object.h QGlib/Object
- QGlib/value.h QGlib/Value
- QGlib/signal.h QGlib/Signal
- QGlib/emitimpl.h
- QGlib/connect.h QGlib/Connect
- QGlib/connectimpl.h
- QGlib/error.h QGlib/Error
-
- QGst/global.h QGst/Global
- QGst/enums.h
- QGst/structs.h QGst/Fourcc
- QGst/Fraction
- QGst/IntRange
- QGst/DoubleRange
- QGst/FractionRange
- QGst/structure.h QGst/Structure
- QGst/caps.h QGst/Caps
- QGst/miniobject.h QGst/MiniObject
- QGst/object.h QGst/Object
- QGst/pad.h QGst/Pad
- QGst/ghostpad.h QGst/GhostPad
- QGst/element.h QGst/Element
- QGst/pluginfeature.h QGst/PluginFeature
- QGst/elementfactory.h QGst/ElementFactory
- QGst/bin.h QGst/Bin
- QGst/childproxy.h QGst/ChildProxy
- QGst/pipeline.h QGst/Pipeline
- QGst/message.h QGst/Message
- QGst/bus.h QGst/Bus
- QGst/parse.h QGst/Parse
- QGst/urihandler.h QGst/UriHandler
- QGst/videoorientation.h QGst/VideoOrientation
- QGst/xoverlay.h QGst/XOverlay
- QGst/streamvolume.h QGst/StreamVolume
- QGst/colorbalance.h QGst/ColorBalance
- QGst/propertyprobe.h QGst/PropertyProbe
- QGst/query.h QGst/Query
- QGst/clock.h QGst/Clock
- QGst/buffer.h QGst/Buffer
- QGst/event.h QGst/Event
-
- QGst/Ui/videowidget.h QGst/Ui/VideoWidget
-)
-
-set(CODEGEN_HEADERS
- QGlib/type.h
- QGlib/paramspec.h
- QGlib/object.h
- QGlib/signal.h
- QGlib/value.h
-
- QGst/enums.h
- QGst/structs.h
- QGst/structure.h
- QGst/caps.h
- QGst/miniobject.h
- QGst/object.h
- QGst/pad.h
- QGst/ghostpad.h
- QGst/element.h
- QGst/pluginfeature.h
- QGst/elementfactory.h
- QGst/bin.h
- QGst/childproxy.h
- QGst/pipeline.h
- QGst/message.h
- QGst/bus.h
- QGst/urihandler.h
- QGst/videoorientation.h
- QGst/xoverlay.h
- QGst/streamvolume.h
- QGst/colorbalance.h
- QGst/propertyprobe.h
- QGst/query.h
- QGst/clock.h
- QGst/buffer.h
- QGst/event.h
-)
-
-set(CODEGEN_INCLUDES
- -Igst/gst.h
- -Igst/interfaces/interfaces-enumtypes.h
- -Igst/interfaces/xoverlay.h
- -Igst/interfaces/streamvolume.h
- -Igst/interfaces/colorbalance.h
- -Igst/interfaces/videoorientation.h
- -Igst/interfaces/propertyprobe.h
-)
-
-# Setup the environment
-include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GSTREAMER_INCLUDE_DIR}
- ${GSTREAMER_INTERFACES_INCLUDE_DIR}
- ${GLIB2_INCLUDE_DIR} ${QTGSTREAMER_INCLUDES})
-add_definitions(${QTGSTREAMER_DEFINITIONS} -DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QTGSTREAMER_FLAGS}")
-
-
-# Add command to generate gen.cpp using codegen
-add_custom_command(OUTPUT gen.cpp
- COMMAND codegen
- ARGS ${CODEGEN_INCLUDES} ${CODEGEN_HEADERS} > ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
- DEPENDS codegen ${CODEGEN_HEADERS}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
-
-# Build and link QtGStreamer
-if(QTGSTREAMER_STATIC)
- automoc4_add_library(QtGStreamer STATIC ${QtGStreamer_SRCS})
-else()
- automoc4_add_library(QtGStreamer SHARED ${QtGStreamer_SRCS})
-endif()
-
-set_target_properties(QtGStreamer PROPERTIES SOVERSION ${QTGSTREAMER_SOVERSION}
- VERSION ${QTGSTREAMER_VERSION})
-target_link_libraries(QtGStreamer ${QT_QTCORE_LIBRARY} ${GSTREAMER_LIBRARY}
- ${GSTREAMER_INTERFACES_LIBRARY} ${GOBJECT_LIBRARIES})
-target_link_libraries(QtGStreamer LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY})
-
-
-# Build and link QtGStreamerUi
-if(QTGSTREAMER_STATIC)
- automoc4_add_library(QtGStreamerUi STATIC ${QtGStreamerUi_SRCS})
+if (QTGSTREAMER_STATIC)
+ set(SHARED_OR_STATIC "STATIC")
else()
- automoc4_add_library(QtGStreamerUi SHARED ${QtGStreamerUi_SRCS})
+ set(SHARED_OR_STATIC "SHARED")
endif()
-set_target_properties(QtGStreamerUi PROPERTIES SOVERSION ${QTGSTREAMER_SOVERSION}
- VERSION ${QTGSTREAMER_VERSION})
-target_link_libraries(QtGStreamerUi ${QT_QTGUI_LIBRARY} QtGStreamer)
-target_link_libraries(QtGStreamerUi LINK_INTERFACE_LIBRARIES ${QT_QTGUI_LIBRARY} QtGStreamer)
-
+# Macro to run codegen from the subdirs
+macro(run_codegen _dir_name _includes _headers)
+ set(_prefixed_headers "")
+ foreach(_header ${_headers})
+ list(APPEND _prefixed_headers ${_dir_name}/${_header})
+ endforeach()
+
+ add_custom_command(OUTPUT gen.cpp
+ COMMAND codegen
+ ARGS ${_includes} ${_prefixed_headers}
+ > ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
+ DEPENDS codegen ${_headers}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+endmacro()
+
+# Macro to install headers from the subdirs
+macro(install_headers _dir_name)
+ foreach(header ${ARGN})
+ get_filename_component(header_path ${header} PATH)
+ install(FILES ${header} DESTINATION ${INCLUDES_INSTALL_DIR}/${_dir_name}/${header_path})
+ endforeach()
+endmacro()
+
+# Setup common environment
+include_directories(${QTGSTREAMER_INCLUDES})
+add_definitions(${QTGSTREAMER_DEFINITIONS})
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QTGSTREAMER_FLAGS}")
-# Install the library
-install(TARGETS QtGStreamer DESTINATION ${CMAKE_INSTALL_PREFIX}/lib EXPORT QtGStreamerTargets)
-install(TARGETS QtGStreamerUi DESTINATION ${CMAKE_INSTALL_PREFIX}/lib EXPORT QtGStreamerTargets)
+# Build the libraries
+add_subdirectory(QGlib)
+add_subdirectory(QGst)
# Install the cmake scripts that are used to find the installed library from external projects
-install(EXPORT QtGStreamerTargets DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/QtGStreamer)
+install(EXPORT ${EXPORT_TARGET_SET} DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer)
install(FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindQtGStreamer.cmake
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/QtGStreamer
+ DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer
RENAME QtGStreamerConfig.cmake)
-
-# Install the headers
-foreach(header ${INSTALLED_HEADERS})
- get_filename_component(header_path ${header} PATH)
- install(FILES ${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/QtGStreamer/${header_path})
-endforeach(header ${INSTALLED_HEADERS})
diff --git a/src/QGlib/CMakeLists.txt b/src/QGlib/CMakeLists.txt
new file mode 100644
index 0000000..02b59b6
--- /dev/null
+++ b/src/QGlib/CMakeLists.txt
@@ -0,0 +1,61 @@
+set(QtGLib_SRCS
+ quark.cpp
+ type.cpp
+ paramspec.cpp
+ object.cpp
+ value.cpp
+ signal.cpp
+ error.cpp
+ connect.cpp
+ wrap.cpp
+ init.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
+)
+
+set(QtGLib_INSTALLED_HEADERS
+ global.h
+ quark.h Quark
+ type.h Type
+ refpointer.h RefPointer
+ wrap.h
+ paramspec.h ParamSpec
+ object.h Object
+ value.h Value
+ signal.h Signal
+ emitimpl.h
+ connect.h Connect
+ connectimpl.h
+ error.h Error
+)
+
+set(QtGLib_CODEGEN_HEADERS
+ type.h
+ paramspec.h
+ object.h
+ signal.h
+ value.h
+)
+
+set(QtGLib_CODEGEN_INCLUDES
+ -Iglib-object.h
+)
+
+# Setup the environment
+set(QTGLIB_API_VERSION 2.0)
+set(QTGLIB_SOVERSION 0)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GOBJECT_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR})
+
+# Add command to generate gen.cpp using codegen
+run_codegen("QGlib" "${QtGLib_CODEGEN_INCLUDES}" "${QtGLib_CODEGEN_HEADERS}")
+
+# Build and link QtGLib
+automoc4_add_library(QtGLib ${SHARED_OR_STATIC} ${QtGLib_SRCS})
+set_target_properties(QtGLib PROPERTIES OUTPUT_NAME QtGLib-${QTGLIB_API_VERSION}
+ SOVERSION ${QTGLIB_SOVERSION}
+ VERSION ${QTGSTREAMER_VERSION})
+target_link_libraries(QtGLib ${QT_QTCORE_LIBRARY} ${GOBJECT_LIBRARIES})
+target_link_libraries(QtGLib LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY})
+
+# Install
+install(TARGETS QtGLib DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
+install_headers("QGlib" ${QtGLib_INSTALLED_HEADERS})
diff --git a/src/QGst/CMakeLists.txt b/src/QGst/CMakeLists.txt
new file mode 100644
index 0000000..9538379
--- /dev/null
+++ b/src/QGst/CMakeLists.txt
@@ -0,0 +1,145 @@
+set(QtGStreamer_SRCS
+ global.cpp
+ objectstore.cpp
+ value.cpp
+ structure.cpp
+ caps.cpp
+ miniobject.cpp
+ object.cpp
+ pad.cpp
+ ghostpad.cpp
+ element.cpp
+ pluginfeature.cpp
+ elementfactory.cpp
+ bin.cpp
+ childproxy.cpp
+ pipeline.cpp
+ message.cpp
+ bus.cpp
+ parse.cpp
+ urihandler.cpp
+ videoorientation.cpp
+ xoverlay.cpp
+ streamvolume.cpp
+ colorbalance.cpp
+ propertyprobe.cpp
+ query.cpp
+ clock.cpp
+ buffer.cpp
+ event.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
+)
+
+set(QtGStreamerUi_SRCS
+ Ui/videowidget.cpp
+)
+
+set(QtGStreamer_INSTALLED_HEADERS
+ global.h Global
+ enums.h
+ structs.h Fourcc
+ Fraction
+ IntRange
+ DoubleRange
+ FractionRange
+ structure.h Structure
+ caps.h Caps
+ miniobject.h MiniObject
+ object.h Object
+ pad.h Pad
+ ghostpad.h GhostPad
+ element.h Element
+ pluginfeature.h PluginFeature
+ elementfactory.h ElementFactory
+ bin.h Bin
+ childproxy.h ChildProxy
+ pipeline.h Pipeline
+ message.h Message
+ bus.h Bus
+ parse.h Parse
+ urihandler.h UriHandler
+ videoorientation.h VideoOrientation
+ xoverlay.h XOverlay
+ streamvolume.h StreamVolume
+ colorbalance.h ColorBalance
+ propertyprobe.h PropertyProbe
+ query.h Query
+ clock.h Clock
+ buffer.h Buffer
+ event.h Event
+
+ Ui/videowidget.h Ui/VideoWidget
+)
+
+set(QtGStreamer_CODEGEN_HEADERS
+ enums.h
+ structs.h
+ structure.h
+ caps.h
+ miniobject.h
+ object.h
+ pad.h
+ ghostpad.h
+ element.h
+ pluginfeature.h
+ elementfactory.h
+ bin.h
+ childproxy.h
+ pipeline.h
+ message.h
+ bus.h
+ urihandler.h
+ videoorientation.h
+ xoverlay.h
+ streamvolume.h
+ colorbalance.h
+ propertyprobe.h
+ query.h
+ clock.h
+ buffer.h
+ event.h
+)
+
+set(QtGStreamer_CODEGEN_INCLUDES
+ -Igst/gst.h
+ -Igst/interfaces/interfaces-enumtypes.h
+ -Igst/interfaces/xoverlay.h
+ -Igst/interfaces/streamvolume.h
+ -Igst/interfaces/colorbalance.h
+ -Igst/interfaces/videoorientation.h
+ -Igst/interfaces/propertyprobe.h
+ -IQGlib/Quark
+)
+
+
+# Setup the environment
+set(QTGSTREAMER_API_VERSION 0.10)
+set(QTGSTREAMER_SOVERSION 0)
+set(QTGSTREAMER_UI_SOVERSION 0)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GSTREAMER_INCLUDE_DIR}
+ ${GSTREAMER_INTERFACES_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR})
+add_definitions(-DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
+
+# Add command to generate gen.cpp using codegen
+run_codegen("QGst" "${QtGStreamer_CODEGEN_INCLUDES}" "${QtGStreamer_CODEGEN_HEADERS}")
+
+# Build and link QtGStreamer
+automoc4_add_library(QtGStreamer ${SHARED_OR_STATIC} ${QtGStreamer_SRCS})
+set_target_properties(QtGStreamer PROPERTIES OUTPUT_NAME QtGStreamer-${QTGSTREAMER_API_VERSION}
+ SOVERSION ${QTGSTREAMER_SOVERSION}
+ VERSION ${QTGSTREAMER_VERSION})
+target_link_libraries(QtGStreamer ${QT_QTCORE_LIBRARY} ${QTGLIB_LIBRARY}
+ ${GSTREAMER_LIBRARY} ${GSTREAMER_INTERFACES_LIBRARY})
+target_link_libraries(QtGStreamer LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY} ${QTGLIB_LIBRARY})
+
+# Build and link QtGStreamerUi
+automoc4_add_library(QtGStreamerUi ${SHARED_OR_STATIC} ${QtGStreamerUi_SRCS})
+set_target_properties(QtGStreamerUi PROPERTIES OUTPUT_NAME QtGStreamerUi-${QTGSTREAMER_API_VERSION}
+ SOVERSION ${QTGSTREAMER_UI_SOVERSION}
+ VERSION ${QTGSTREAMER_VERSION})
+target_link_libraries(QtGStreamerUi ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY})
+
+# Install
+install(TARGETS QtGStreamer DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
+install(TARGETS QtGStreamerUi DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET})
+install_headers("QGst" ${QtGStreamer_INSTALLED_HEADERS})
diff --git a/tests/compilation/CMakeLists.txt b/tests/compilation/CMakeLists.txt
index e015dd4..d8e7edb 100644
--- a/tests/compilation/CMakeLists.txt
+++ b/tests/compilation/CMakeLists.txt
@@ -1,5 +1,6 @@
add_test(NAME compilation_tests
COMMAND ${CMAKE_COMMAND}
+ -DQTGLIB_LIBRARY=$<TARGET_FILE:${QTGLIB_LIBRARY}>
-DQTGSTREAMER_LIBRARY=$<TARGET_FILE:${QTGSTREAMER_LIBRARY}>
-DQTGSTREAMER_UI_LIBRARY=$<TARGET_FILE:${QTGSTREAMER_UI_LIBRARY}>
-DQTGSTREAMER_INCLUDE_DIR=${QTGSTREAMER_INCLUDE_DIR}
diff --git a/tests/compilation/RunCompilationTests.cmake b/tests/compilation/RunCompilationTests.cmake
index 6d3c489..dec959e 100644
--- a/tests/compilation/RunCompilationTests.cmake
+++ b/tests/compilation/RunCompilationTests.cmake
@@ -12,6 +12,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${SOURCE_DIR}/CompilationTests.
# Run cmake to execute the tests
execute_process(COMMAND ${CMAKE_COMMAND}
+ -DQTGLIB_LIBRARY=${QTGLIB_LIBRARY}
-DQTGSTREAMER_LIBRARY=${QTGSTREAMER_LIBRARY}
-DQTGSTREAMER_UI_LIBRARY=${QTGSTREAMER_UI_LIBRARY}
-DQTGSTREAMER_INCLUDE_DIR=${QTGSTREAMER_INCLUDE_DIR}