forked from miek/inspectrum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (75 loc) · 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
90
cmake_minimum_required(VERSION 2.8)
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 (WIN32)
find_library (MMAN mman)
if(NOT(MMAN))
message(FATAL_ERROR "please install mman-win32")
else(NOT(MMAN))
set (extraLibs ${extraLibs} ${MMAN})
endif(NOT(MMAN))
ENDIF (WIN32)
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
amplitudedemod.cpp
cursor.cpp
cursors.cpp
main.cpp
fft.cpp
frequencydemod.cpp
mainwindow.cpp
inputsource.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
)
INCLUDE(FindPkgConfig)
find_package(Qt5Widgets REQUIRED)
pkg_check_modules(FFTW REQUIRED fftw3f)
find_package(Liquid REQUIRED)
include_directories(
${QT_INCLUDES}
${FFTW_INCLUDEDIR}
${FFTW_INCLUDE_DIRS}
${LIQUID_INCLUDES}
)
link_directories(
${FFTW_LIBRARY_DIRS}
)
add_executable(inspectrum ${inspectrum_sources})
qt5_use_modules(inspectrum Widgets Concurrent)
target_link_libraries(inspectrum
${QT_LIBRARIES}
${FFTW_LIBRARIES}
${LIQUID_LIBRARIES}
${extraLibs}
)
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
)