File: CMakeLists.txt

package info (click to toggle)
limesuite 18.06.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 24,728 kB
  • sloc: cpp: 154,989; ansic: 6,823; python: 140; sh: 50; makefile: 32
file content (303 lines) | stat: -rw-r--r-- 10,574 bytes parent folder | download
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
########################################################################
## public headers
########################################################################
set(LIME_SUITE_PUBLIC_HEADERS
    lime/LimeSuite.h
    VersionInfo.h
    Logger.h
    SystemResources.h
    LimeSuiteConfig.h
    ADF4002/ADF4002.h
    lms7002m_mcu/MCU_BD.h
    lms7002m_mcu/MCU_File.h
    ConnectionRegistry/IConnection.h
    ConnectionRegistry/ConnectionHandle.h
    ConnectionRegistry/ConnectionRegistry.h
    lms7002m/LMS7002M.h
    lms7002m/LMS7002M_RegistersMap.h
    lime/LMS7002M_parameters.h
    protocols/Streamer.h
    protocols/ADCUnits.h
    protocols/LMS64CCommands.h
    protocols/LMS64CProtocol.h
    protocols/LMSBoards.h
    protocols/dataTypes.h
    protocols/fifo.h
    Si5351C/Si5351C.h
    FPGA_common/FPGA_common.h
    API/lms7_device.h
)

include(FeatureSummary)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_HEADERS "Enable install headers" ON "TRUE" OFF)
add_feature_info(LimeSuiteHeaders ENABLE_HEADERS "The lime suite headers")
if (ENABLE_HEADERS)
    install(
        FILES ${LIME_SUITE_PUBLIC_HEADERS}
        DESTINATION include/lime
    )
endif()

########################################################################
## lime suite library
########################################################################
set(LIME_SUITE_SOURCES
    Logger.cpp
    ADF4002/ADF4002.cpp
    lms7002m_mcu/MCU_BD.cpp
    ConnectionRegistry/IConnection.cpp
    ConnectionRegistry/ConnectionHandle.cpp
    ConnectionRegistry/ConnectionRegistry.cpp
    lms7002m/LMS7002M_RegistersMap.cpp
    lms7002m/LMS7002M_parameters.cpp
    lms7002m/LMS7002M.cpp
    lms7002m/LMS7002M_RxTxCalibrations.cpp
    lms7002m/LMS7002M_BaseCalibrations.cpp
    lms7002m/goert.cpp
    lms7002m/mcu_dc_iq_calibration.cpp
    lms7002m/LMS7002M_filtersCalibration.cpp
    lms7002m/LMS7002M_gainCalibrations.cpp
    protocols/LMS64CProtocol.cpp
    protocols/Streamer.cpp
    protocols/ConnectionImages.cpp
    Si5351C/Si5351C.cpp
    ${PROJECT_SOURCE_DIR}/external/kissFFT/kiss_fft.c
    API/lms7_api.cpp
    API/lms7_device.cpp
    API/LmsGeneric.cpp
    API/qLimeSDR.cpp
    API/LimeSDR_mini.cpp
    API/LimeSDR.cpp
    FPGA_common/FPGA_common.cpp
    FPGA_common/FPGA_Mini.cpp
    FPGA_common/FPGA_Q.cpp
    windowFunction.cpp
)

set(LIME_SUITE_INCLUDES
    ${CMAKE_CURRENT_SOURCE_DIR}
    API
    lime
    GFIR
    protocols
    ConnectionRegistry
    lms7002m_mcu
    ADF4002
    Si5351C
    lms7002m
    LTEpackets
    FPGA_common
    lms7002m_mcu
    ${PROJECT_SOURCE_DIR}/external/cpp-feather-ini-parser
    HPM7
    ${PROJECT_SOURCE_DIR}/external/kissFFT/
)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/VersionInfo.in.cpp
    ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cpp @ONLY)
list(APPEND LIME_SUITE_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cpp)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SystemResources.in.cpp
    ${CMAKE_CURRENT_BINARY_DIR}/SystemResources.cpp @ONLY)
list(APPEND LIME_SUITE_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/SystemResources.cpp)

if(CMAKE_COMPILER_IS_GNUCXX)
    list(APPEND LIME_SUITE_LIBRARIES -pthread)
endif(CMAKE_COMPILER_IS_GNUCXX)

list(APPEND LIME_SUITE_LIBRARIES atomic)

include(FeatureSummary)
include(CMakeDependentOption)
option(ENABLE_LIBRARY "Enable build library" ON)
add_feature_info(LimeSuiteLibrary ENABLE_LIBRARY "The lime suite library")
if (ENABLE_LIBRARY)
    add_library(LimeSuite ${LIME_SUITE_SOURCES})
    target_link_libraries(LimeSuite ${LIME_SUITE_LIBRARIES})
    set_property(TARGET LimeSuite PROPERTY POSITION_INDEPENDENT_CODE TRUE)
    set_target_properties(LimeSuite PROPERTIES SOVERSION ${LIME_SUITE_SOVER})
    set_target_properties(LimeSuite PROPERTIES VERSION ${LIME_SUITE_LIBVER})
    set_target_properties(LimeSuite PROPERTIES DEFINE_SYMBOL "LIME_DLL_EXPORTS")
    target_include_directories(LimeSuite PUBLIC ${LIME_SUITE_INCLUDES})
    if(BUILD_SHARED_LIBS)
        target_compile_definitions(LimeSuite PUBLIC "LIME_DLL")
    endif()

    install(TARGETS LimeSuite
        LIBRARY DESTINATION lib${LIB_SUFFIX} # .so file
        ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
        RUNTIME DESTINATION bin              # .dll file
    )

	if (MSVC)
		set_target_properties(LimeSuite PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
	endif(MSVC)

    add_subdirectory(GFIR)
    set(LIME_SUITE_LIBS LimeSuite)
endif()

########################################################################
## Supported connections
########################################################################
include(ConnectionEVB7COM/CMakeLists.txt)
include(ConnectionFX3/CMakeLists.txt)
include(ConnectionSTREAM_UNITE/CMakeLists.txt)
#include(ConnectionNovenaRF7/CMakeLists.txt)
include(ConnectionFTDI/CMakeLists.txt)
include(ConnectionXillybus/CMakeLists.txt)

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/ConnectionRegistry/BuiltinConnections.in.cpp
    ${CMAKE_CURRENT_BINARY_DIR}/BuiltinConnections.cpp
)

target_sources(LimeSuite PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/BuiltinConnections.cpp)

########################################################################
## wx widgets dependency
########################################################################
set(wxWidgets_USE_DEBUG OFF)
set(wxWidgets_USE_UNICODE ON)
set(wxWidgets_USE_UNIVERSAL OFF)
set(wxWidgets_USE_STATIC ON)
find_package(wxWidgets COMPONENTS richtext xml html xrc adv aui core base gl)
message(STATUS "wxWidgets_DEFINITIONS: ${wxWidgets_DEFINITIONS}")
message(STATUS "wxWidgets_INCLUDE_DIRS: ${wxWidgets_INCLUDE_DIRS}")
message(STATUS "wxWidgets_LIBRARIES: ${wxWidgets_LIBRARIES}")

########################################################################
## LimeSuite GUI app
########################################################################
set(LMS7SUITE_GUI_SOURCES
    ADF4002/ADF4002_wxgui.cpp
    lms7002_wxgui/lms7002_pnlXBUF_view.cpp
    lms7002_wxgui/lms7002_wxgui.cpp
    lms7002_wxgui/lms7002_pnlRFE_view.cpp
    lms7002_wxgui/lms7002_pnlCalibrations_view.cpp
    lms7002_wxgui/lms7002_pnlTRF_view.cpp
    lms7002_wxgui/lms7002_pnlCDS_view.cpp
    lms7002_wxgui/lms7002_pnlLimeLightPAD_view.cpp
    lms7002_wxgui/lms7002_pnlBIST_view.cpp
    lms7002_wxgui/dlgViewIRAM.cpp
    lms7002_wxgui/lms7002_gui_utilities.cpp
    lms7002_wxgui/lms7002_pnlSX_view.cpp
    lms7002_wxgui/lms7002_pnlTBB_view.cpp
    lms7002_wxgui/lms7002_dlgVCOfrequencies.cpp
    lms7002_wxgui/lms7002_pnlRBB_view.cpp
    lms7002_wxgui/lms7002_pnlLDO_view.cpp
    lms7002_wxgui/lms7002_pnlAFE_view.cpp
    lms7002_wxgui/lms7002_pnlGains_view.cpp
    lms7002_wxgui/CoefficientFileParser.cpp
    lms7002_wxgui/lms7002_pnlRxTSP_view.cpp
    lms7002_wxgui/lms7002_mainPanel.cpp
    lms7002_wxgui/pnlBoardControls.cpp
    lms7002_wxgui/dlgViewSFR.cpp
    lms7002_wxgui/lms7002_pnlCLKGEN_view.cpp
    lms7002_wxgui/lms7002_pnlMCU_BD_view.cpp
    lms7002_wxgui/lms7002_pnlBIAS_view.cpp
    lms7002_wxgui/lms7002_dlgGFIR_Coefficients.cpp
    lms7002_wxgui/lms7002_pnlTxTSP_view.cpp
    lms7002_wxgui/lms7002_pnlR3.cpp
    LMS_Programing/LMS_Programing_wxgui.cpp
    utilities_gui/dlgConnectionSettings.cpp
    utilities_gui/pnlMiniLog.cpp
    utilities_gui/SPI_wxgui.cpp
    utilities_gui/dlgFullMessageLog.cpp
    utilities_gui/dlgDeviceInfo.cpp
    utilities_gui/utilities_gui.cpp
    lms7suiteAppFrame.cpp
    boards_wxgui/lms7002m_novena_wxgui.cpp
    RFSpark/RFSpark_wxgui.cpp
    Si5351C/Si5351C_wxgui.cpp
    lms7suiteApp_gui.cpp
    lms7suiteApp.cpp
    FPGAcontrols_wxgui/FPGAcontrols_wxgui.cpp
    HPM7/HPM7_wxgui.cpp
    dlgAbout.cpp
    numericSlider/numericSlider.cpp
    myriad7/myriad7_wxgui.cpp
    fftviewer_wxgui/fftviewer_wxgui.cpp
    fftviewer_wxgui/fftviewer_frFFTviewer.cpp
    lms7suiteEvents/lms7suiteEvents.cpp
    boards_wxgui/pnlQSpark.cpp
    boards_wxgui/pnluLimeSDR.cpp
    boards_wxgui/pnlUltimateEVB.cpp
    boards_wxgui/pnlBuffers.cpp
    ${PROJECT_SOURCE_DIR}/external/kissFFT/kiss_fft.c
    windowFunction.cpp
    boards_wxgui/pnlLimeSDR.cpp
)

include(FeatureSummary)
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_GUI "Enable build GUI" ON "ENABLE_LIBRARY;wxWidgets_FOUND" OFF)
add_feature_info(LimeSuiteGUI ENABLE_GUI "GUI Application for LimeSuite")
if (ENABLE_GUI)

    include_directories(lms7002_wxgui)
    include_directories(LMS_Programing)
    include_directories(utilities_gui)
    include_directories(RFSpark)
    include_directories(FPGAcontrols_wxgui)
    include_directories(numericSlider)
    include_directories(myriad7)
    include_directories(fftviewer_wxgui)
    include_directories(lms7suiteEvents)
    include_directories(boards_wxgui)
    include(${wxWidgets_USE_FILE})
    add_subdirectory(oglGraph)

    set(BINARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")

    add_executable(LimeSuiteGUI ${LMS7SUITE_GUI_SOURCES} resources/resource.rc)
    set_target_properties(LimeSuiteGUI PROPERTIES
        RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_DIR})
    target_link_libraries(LimeSuiteGUI LimeSuite oglGraph ${wxWidgets_LIBRARIES})

    if (MSVC)
        set_property(TARGET LimeSuiteGUI APPEND PROPERTY LINK_FLAGS /SUBSYSTEM:WINDOWS)
    endif(MSVC)

    install(TARGETS LimeSuiteGUI DESTINATION bin)

endif()

########################################################################
# Build pkg config file
########################################################################
if (ENABLE_HEADERS AND ENABLE_LIBRARY)
configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/LimeSuite.pc.in
    ${CMAKE_CURRENT_BINARY_DIR}/LimeSuite.pc
@ONLY)

install(
    FILES ${CMAKE_CURRENT_BINARY_DIR}/LimeSuite.pc
    DESTINATION lib${LIB_SUFFIX}/pkgconfig
)
endif (ENABLE_HEADERS AND ENABLE_LIBRARY)

########################################################################
# boardEmulator -- creates serial port and imitates board communications
########################################################################
if(UNIX)
    add_executable(boardEmulator boardEmulator.cpp)
    target_link_libraries(boardEmulator LimeSuite)
endif()

#########################################################################
# utilities
#########################################################################
add_subdirectory(utilities)

#########################################################################
# tests
#########################################################################
add_subdirectory(tests)

#########################################################################
# examples
#########################################################################
add_subdirectory(examples)