Statistics
| Branch: | Tag: | Revision:

root / gr-video-sdl / src / CMakeLists.txt @ 70ca9bea

History | View | Annotate | Download (3.6 kB)

1
# Copyright 2011 Free Software Foundation, Inc.
2
# 
3
# This file is part of GNU Radio
4
# 
5
# GNU Radio is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3, or (at your option)
8
# any later version.
9
# 
10
# GNU Radio is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
14
# 
15
# You should have received a copy of the GNU General Public License
16
# along with GNU Radio; see the file COPYING.  If not, write to
17
# the Free Software Foundation, Inc., 51 Franklin Street,
18
# Boston, MA 02110-1301, USA.
19
20
########################################################################
21
# Setup the include and linker paths
22
########################################################################
23
include_directories(
24
    ${GNURADIO_CORE_INCLUDE_DIRS}
25
    ${GR_VIDEO_SDL_INCLUDE_DIRS}
26
)
27
28
include_directories(${Boost_INCLUDE_DIRS})
29
link_directories(${Boost_LIBRARY_DIRS})
30
31
include_directories(${SDL_INCLUDE_DIR})
32
33
########################################################################
34
# Setup library
35
########################################################################
36
list(APPEND gr_video_sdl_sources
37
    video_sdl_sink_uc.cc
38
    video_sdl_sink_s.cc
39
)
40
41
list(APPEND video_sdl_libs
42
    gnuradio-core
43
    ${Boost_LIBRARIES}
44
    ${SDL_LIBRARY}
45
)
46
47
add_library(gnuradio-video-sdl SHARED ${gr_video_sdl_sources})
48
target_link_libraries(gnuradio-video-sdl ${video_sdl_libs})
49
GR_LIBRARY_FOO(gnuradio-video-sdl RUNTIME_COMPONENT "video_sdl_runtime" DEVEL_COMPONENT "video_sdl_devel")
50
51
########################################################################
52
# Install public header files
53
########################################################################
54
install(FILES
55
    video_sdl_api.h
56
    video_sdl_sink_uc.h
57
    video_sdl_sink_s.h
58
    DESTINATION ${GR_INCLUDE_DIR}/gnuradio
59
    COMPONENT "video_sdl_devel"
60
)
61
62
########################################################################
63
# Setup swig generation
64
########################################################################
65
if(ENABLE_PYTHON)
66
include(GrPython)
67
include(GrSwig)
68
69
set(GR_SWIG_INCLUDE_DIRS
70
    ${GR_COMEDI_INCLUDE_DIRS}
71
    ${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
72
)
73
74
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/video_sdl_swig_doc.i)
75
set(GR_SWIG_DOC_DIRS ${GR_VIDEO_SDL_INCLUDE_DIRS})
76
77
set(GR_SWIG_LIBRARIES gnuradio-video-sdl)
78
79
GR_SWIG_MAKE(video_sdl video_sdl.i)
80
81
GR_SWIG_INSTALL(
82
    TARGETS video_sdl
83
    DESTINATION ${GR_PYTHON_DIR}/gnuradio
84
    COMPONENT "video_sdl_python"
85
)
86
87
install(
88
    FILES video_sdl.i
89
    ${CMAKE_CURRENT_BINARY_DIR}/video_sdl_swig_doc.i
90
    DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
91
    COMPONENT "video_sdl_swig"
92
)
93
94
endif(ENABLE_PYTHON)
95
96
########################################################################
97
# Handle the unit tests
98
########################################################################
99
if(ENABLE_TESTING AND ENABLE_PYTHON)
100
include(GrTest)
101
file(GLOB py_qa_test_files "qa_*.py")
102
foreach(py_qa_test_file ${py_qa_test_files})
103
    get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
104
    set(GR_TEST_PYTHON_DIRS
105
        ${CMAKE_BINARY_DIR}/gnuradio-core/src/python
106
        ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
107
        ${CMAKE_BINARY_DIR}/gr-video-sdl/src
108
    )
109
    set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-video-sdl)
110
    GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file})
111
endforeach(py_qa_test_file)
112
endif(ENABLE_TESTING AND ENABLE_PYTHON)