-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathCMakeLists.txt
110 lines (98 loc) · 2.43 KB
/
CMakeLists.txt
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
103
104
105
106
107
108
109
110
# Copyright 2018 Analog Devices, Inc.
#
# This program 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.
#
# This program 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.
set(PLUGINS
generic_dac
fmcomms2
fmcomms2_adv
fmcomms5
fmcomms6
fmcomms11
ad9371
ad9371_adv
adrv9009
adrv9009_adv
ad6676
fmcadc3
daq2
ad9739a
AD5628_1
#AD7303
cn0357
cn0508
cn0511
cn0540
pr_config
motor_control
lidar
dmm
debug
#spectrum_analyzer
scpi
ad9081
ad9084
adrv9002
cf_axi_tdd
xmw
)
set(LIBAD9166_PLUGINS cn0511)
set(LIBAD9361_PLUGINS
fmcomms2
fmcomms2_adv
spectrum_analyzer
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
list(REMOVE_ITEM PLUGINS spectrum_analyzer scpi)
set(EXTRA_WIN_LIBRARIES winpthread)
endif()
if("${LIBAD9166_LIBRARIES}" STREQUAL "")
message(WARNING "libad9166 not found. The following plugins will not be installed: ${LIBAD9166_PLUGINS}")
list(REMOVE_ITEM PLUGINS ${LIBAD9166_PLUGINS})
endif()
if("${LIBAD9361_LIBRARIES}" STREQUAL "")
message(WARNING "libad9361 not found. The following plugins will not be installed: ${LIBAD9361_PLUGINS}")
list(REMOVE_ITEM PLUGINS ${LIBAD9361_PLUGINS})
endif()
set(PLUGIN_GLADE_FILES "")
foreach(plugin ${PLUGINS})
add_library(${plugin} ${plugin}.c)
# We just include all the paths that work for all plugins. Keeping it on a per plugins
# basis seems like unnecessary overhead/work
target_include_directories(${plugin} PRIVATE
${GTK_INCLUDE_DIRS}
${LIBIIO_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIRS}
${LIBAD9361_INCLUDE_DIRS}
${LIBAD9166_INCLUDE_DIRS}
)
target_link_libraries(${plugin} PRIVATE
${GTK_LIBRARIES}
${LIBIIO_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBAD9361_LIBRARIES}
${LIBAD9166_LIBRARIES}
${EXTRA_WIN_LIBRARIES}
osc
m
)
set_target_properties(${plugin} PROPERTIES
PREFIX ""
)
endforeach()
install(TARGETS ${PLUGINS}
LIBRARY DESTINATION ${PLIB_DEST}
RUNTIME DESTINATION ${PLIB_DEST}
)