~ubuntu-branches/ubuntu/saucy/qt-gstreamer/saucy-proposed

« back to all changes in this revision

Viewing changes to src/CMakeLists.txt

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-06-15 15:03:26 UTC
  • mfrom: (1.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120615150326-pkmdog620pkytcgt
Tags: 0.10.2-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - Enable unit tests.
    + Build-depend on gstreamer0.10-plugins-base.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Common variables
2
 
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
3
 
set(INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/QtGStreamer)
4
1
set(EXPORT_TARGET_SET QtGStreamerTargets)
5
2
 
6
3
if (QTGSTREAMER_STATIC)
14
11
 
15
12
# Macro to run codegen from the subdirs
16
13
macro(run_codegen _dir_name _includes _headers)
17
 
    set(_prefixed_headers "")
18
 
    foreach(_header ${_headers})
19
 
        list(APPEND _prefixed_headers ${_dir_name}/${_header})
20
 
    endforeach()
21
 
 
22
 
    add_custom_command(OUTPUT gen.cpp
23
 
                       COMMAND codegen
24
 
                       ARGS ${_includes} ${_prefixed_headers}
25
 
                              > ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
26
 
                       DEPENDS codegen ${_headers}
27
 
                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
14
    if (QTGSTREAMER_CODEGEN)
 
15
        set(_prefixed_headers "")
 
16
        foreach(_header ${_headers})
 
17
            list(APPEND _prefixed_headers ${_dir_name}/${_header})
 
18
        endforeach()
 
19
 
 
20
        add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/gen.cpp
 
21
                           COMMAND codegen
 
22
                           ARGS ${_includes} ${_prefixed_headers}
 
23
                                > ${CMAKE_CURRENT_SOURCE_DIR}/gen.cpp
 
24
                           DEPENDS codegen ${_headers}
 
25
                           WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
26
    endif()
 
27
 
 
28
    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
 
29
                       COMMAND ${CMAKE_COMMAND}
 
30
                       ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/gen.cpp
 
31
                            ${CMAKE_CURRENT_BINARY_DIR}/gen.cpp
 
32
                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen.cpp
 
33
                       COMMENT "Copying gen.cpp to the build directory")
28
34
endmacro()
29
35
 
30
36
# Macro to install headers from the subdirs
44
50
add_subdirectory(QGlib)
45
51
add_subdirectory(QGst)
46
52
 
 
53
# Build the qml plugin
 
54
if (QT_QTDECLARATIVE_FOUND)
 
55
    add_subdirectory(qml)
 
56
endif()
 
57
 
47
58
# Install the cmake scripts that are used to find the installed library from external projects
48
59
install(EXPORT ${EXPORT_TARGET_SET} DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer)
49
60
install(FILES ${CMAKE_SOURCE_DIR}/cmake/modules/FindQtGStreamer.cmake