Make use of the code generator.
[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/object.cpp
12     ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
13 )
14
15 set(INSTALLED_HEADERS
16     QGlib/global.h
17     QGlib/gdeclarations.h
18     QGlib/quark.h       QGlib/Quark
19     QGlib/type.h        QGlib/Type
20     QGlib/refpointer.h  QGlib/RefPointer
21     QGlib/paramspec.h   QGlib/ParamSpec
22     QGlib/object.h      QGlib/Object
23     QGlib/value.h       QGlib/Value
24     QGlib/closure.h     QGlib/Closure
25
26     QGlib/valueimpl/assert.h
27     QGlib/valueimpl/valueimpl.h
28     QGlib/valueimpl/nativetypes.h
29     QGlib/valueimpl/paramspecptr.h
30     QGlib/valueimpl/objectptr.h
31
32     QGst/global.h
33     QGst/object.h       QGst/Object
34 )
35
36 set(CODEGEN_HEADERS
37     QGlib/type.h
38     QGlib/paramspec.h
39     QGlib/object.h
40     QGlib/closure.h
41     QGst/object.h
42 )
43
44 add_custom_command(OUTPUT gen.cpp
45                    COMMAND codegen
46                    ARGS ${CODEGEN_HEADERS} > ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
47                    DEPENDS codegen ${CODEGEN_HEADERS}
48                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
49
50 automoc4_add_library(QtGstreamer SHARED ${QtGstreamer_SRCS})
51 set_target_properties(QtGstreamer PROPERTIES SOVERSION 0 VERSION 0.0.2)
52 target_link_libraries(QtGstreamer ${QT_QTCORE_LIBRARY} ${GSTREAMER_LIBRARIES}
53                                   ${GSTREAMER_INTERFACE_LIBRARY} ${GOBJECT_LIBRARIES})
54 target_link_libraries(QtGstreamer LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY})
55
56
57 install(TARGETS QtGstreamer DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
58
59 foreach(header ${INSTALLED_HEADERS})
60     get_filename_component(header_path ${header} PATH)
61     install(FILES ${header} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/QtGstreamer/${header_path})
62 endforeach(header ${INSTALLED_HEADERS})