Add global init/deinit functions.
[qtgstreamer:qtgstreamer.git] / src / CMakeLists.txt
1 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
2
3 set(QtGstreamer_SRCS
4     QGlib/quark.cpp
5     QGlib/type.cpp
6     QGlib/paramspec.cpp
7     QGlib/object.cpp
8     QGlib/value.cpp
9     QGlib/closure.cpp
10
11     QGst/global.cpp
12     QGst/structure.cpp
13     QGst/caps.cpp
14     QGst/miniobject.cpp
15     QGst/object.cpp
16     QGst/pad.cpp
17     QGst/element.cpp
18     QGst/pluginfeature.cpp
19     QGst/elementfactory.cpp
20     QGst/bin.cpp
21     QGst/childproxy.cpp
22     QGst/pipeline.cpp
23     ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
24 )
25
26 set(INSTALLED_HEADERS
27     QGlib/global.h
28     QGlib/gdeclarations.h
29     QGlib/quark.h       QGlib/Quark
30     QGlib/type.h        QGlib/Type
31     QGlib/refpointer.h  QGlib/RefPointer
32     QGlib/paramspec.h   QGlib/ParamSpec
33     QGlib/object.h      QGlib/Object
34     QGlib/value.h       QGlib/Value
35     QGlib/closure.h     QGlib/Closure
36
37     QGlib/valueimpl/assert.h
38     QGlib/valueimpl/valueimpl.h
39     QGlib/valueimpl/nativetypes.h
40     QGlib/valueimpl/paramspecptr.h
41     QGlib/valueimpl/objectptr.h
42
43     QGst/global.h       QGst/Global
44     QGst/enums.h
45     QGst/structure.h    QGst/Structure
46     QGst/caps.h         QGst/Caps
47     QGst/miniobject.h   QGst/MiniObject
48     QGst/object.h       QGst/Object
49     QGst/pad.h          QGst/Pad
50     QGst/element.h      QGst/Element
51     QGst/pluginfeature.h QGst/PluginFeature
52     QGst/elementfactory.h QGst/ElementFactory
53     QGst/bin.h          QGst/Bin
54     QGst/childproxy.h   QGst/ChildProxy
55     QGst/pipeline.h     QGst/Pipeline
56 )
57
58 set(CODEGEN_HEADERS
59     QGlib/type.h
60     QGlib/paramspec.h
61     QGlib/object.h
62     QGlib/closure.h
63
64     QGst/enums.h
65     QGst/structure.h
66     QGst/caps.h
67     QGst/miniobject.h
68     QGst/object.h
69     QGst/pad.h
70     QGst/element.h
71     QGst/pluginfeature.h
72     QGst/elementfactory.h
73     QGst/bin.h
74     QGst/childproxy.h
75     QGst/pipeline.h
76 )
77
78 add_custom_command(OUTPUT gen.cpp
79                    COMMAND codegen
80                    ARGS ${CODEGEN_HEADERS} > ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
81                    DEPENDS codegen ${CODEGEN_HEADERS}
82                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
83
84 automoc4_add_library(QtGstreamer SHARED ${QtGstreamer_SRCS})
85 set_target_properties(QtGstreamer PROPERTIES SOVERSION 0 VERSION 0.0.2)
86 target_link_libraries(QtGstreamer ${QT_QTCORE_LIBRARY} ${GSTREAMER_LIBRARIES}
87                                   ${GSTREAMER_INTERFACE_LIBRARY} ${GOBJECT_LIBRARIES})
88 target_link_libraries(QtGstreamer LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY})
89
90
91 install(TARGETS QtGstreamer DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
92
93 foreach(header ${INSTALLED_HEADERS})
94     get_filename_component(header_path ${header} PATH)
95     install(FILES ${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/QtGstreamer/${header_path})
96 endforeach(header ${INSTALLED_HEADERS})