aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CMakeLists.txt
blob: db29da7bbbe8cff46d4f33ba5835387f259c7202 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
include(GrMiscUtils)

find_package(PythonInterp 2)

add_custom_command(
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fosphor
  OUTPUT fosphor/resource_data.c
  DEPENDS fosphor/fft.cl fosphor/display.cl fosphor/cmap_simple.glsl fosphor/cmap_bicubic.glsl fosphor/cmap_fallback.glsl fosphor/DroidSansMonoDotted.ttf
  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/fosphor/
  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/fosphor/llist.h ${CMAKE_CURRENT_BINARY_DIR}/fosphor/
  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/fosphor/resource_internal.h ${CMAKE_CURRENT_BINARY_DIR}/fosphor/
  COMMAND ${PYTHON_EXECUTABLE} -B mkresources.py fft.cl display.cl cmap_simple.glsl cmap_bicubic.glsl cmap_fallback.glsl DroidSansMonoDotted.ttf > ${CMAKE_CURRENT_BINARY_DIR}/fosphor/resource_data.c
)

include_directories(
	${OPENGL_INCLUDE_DIRS}
	${OpenCL_INCLUDE_DIRS}
	${FREETYPE_INCLUDE_DIRS}
	${Boost_INCLUDE_DIR}
)
link_directories(
	${OPENGL_LIBRARY_DIRS}
	${OpenCL_LIBRARY_DIRS}
	${FREETYPE_LIBRARY_DIRS}
	${Boost_LIBRARY_DIRS}
)

if(ENABLE_PYTHON)
    add_definitions(-DENABLE_PYTHON)
    include_directories(${PYTHON_INCLUDE_DIRS})
endif(ENABLE_PYTHON)

if(ENABLE_GLFW)
    include_directories(${GLFW3_INCLUDE_DIRS})
    link_directories(${GLFW3_LIBRARY_DIRS})
endif(ENABLE_GLFW)

if(ENABLE_QT)
    set(CMAKE_AUTOMOC ON)
    include_directories(${QT_INCLUDE_DIRS})
endif(ENABLE_QT)

list(APPEND fosphor_sources
	fosphor/axis.c
	fosphor/cl.c
	fosphor/cl_compat.c
	fosphor/fosphor.c
	fosphor/gl.c
	fosphor/gl_cmap.c
	fosphor/gl_cmap_gen.c
	fosphor/gl_font.c
	fosphor/resource.c
	fosphor/resource_data.c
	fifo.cc
	base_sink_c_impl.cc
)

list_cond_append(ENABLE_GLFW fosphor_sources glfw_sink_c_impl.cc)
list_cond_append(ENABLE_QT   fosphor_sources QGLSurface.cc qt_sink_c_impl.cc)
list_cond_append(ENABLE_WX   fosphor_sources wx_core_sink_c_impl.cc)

list(APPEND fosphor_libraries 
	${OPENGL_LIBRARIES}
	${OpenCL_LIBRARIES}
	${FREETYPE_LIBRARIES}
	${Boost_LIBRARIES}
	${GNURADIO_ALL_LIBRARIES}
	${CMAKE_DL_LIBS}
)

list_cond_append(ENABLE_PYTHON fosphor_libraries ${PYTHON_LIBRARY})
list_cond_append(ENABLE_GLFW fosphor_libraries ${GLFW3_LIBRARIES})
list_cond_append(ENABLE_QT   fosphor_libraries ${QT_LIBRARIES})

add_library(gnuradio-fosphor SHARED ${fosphor_sources})
target_link_libraries(gnuradio-fosphor ${fosphor_libraries})
set_target_properties(gnuradio-fosphor PROPERTIES DEFINE_SYMBOL "gnuradio_fosphor_EXPORTS")

GR_LIBRARY_FOO(gnuradio-fosphor)