forked from miek/inspectrum
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
89 lines (74 loc) · 2.2 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
cmake_minimum_required(VERSION 2.8.11)
project(inspectrum CXX)
enable_testing()
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
# For OSX - don't clear RPATH on install
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if (MSVC)
#force std::complex<> typedefs in liquiddsp
add_definitions(-D_LIBCPP_COMPLEX)
#enable math definitions in math.h
add_definitions(-D_USE_MATH_DEFINES)
#build a graphical application without the console
option(BUILD_WIN32 "Build win32 app, false for console" TRUE)
if (BUILD_WIN32)
set(EXE_ARGS WIN32)
set(CMAKE_EXE_LINKER_FLAGS "/entry:mainCRTStartup ${CMAKE_EXE_LINKER_FLAGS}")
endif (BUILD_WIN32)
endif (MSVC)
if (NOT CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "-O2")
endif (NOT CMAKE_CXX_FLAGS)
# This only works in cmake >3.1
#set_property(TARGET inspectrum PROPERTY CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
list(APPEND inspectrum_sources
abstractsamplesource.cpp
amplitudedemod.cpp
cursor.cpp
cursors.cpp
main.cpp
fft.cpp
frequencydemod.cpp
mainwindow.cpp
inputsource.cpp
phasedemod.cpp
plot.cpp
plots.cpp
plotview.cpp
samplebuffer.cpp
samplesource.cpp
spectrogramcontrols.cpp
spectrogramplot.cpp
threshold.cpp
traceplot.cpp
tuner.cpp
tunertransform.cpp
util.cpp
)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(FFTW REQUIRED)
find_package(Liquid REQUIRED)
include_directories(
${FFTW_INCLUDES}
${LIQUID_INCLUDES}
)
add_executable(inspectrum ${EXE_ARGS} ${inspectrum_sources})
target_link_libraries(inspectrum
Qt5::Core Qt5::Widgets Qt5::Concurrent
${FFTW_LIBRARIES}
${LIQUID_LIBRARIES}
)
set(INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to CMAKE_INSTALL_PREFIX")
install(TARGETS inspectrum RUNTIME DESTINATION ${INSTALL_DEFAULT_BINDIR})
# Create uninstall target
configure_file(
${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)