forked from zsiciarz/aquila
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
200 lines (172 loc) · 5.98 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
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
cmake_minimum_required(VERSION 2.8.12)
project(Aquila CXX)
set(Aquila_VERSION_MAJOR 3)
set(Aquila_VERSION_MINOR 0)
set(Aquila_VERSION_PATCH 0)
set(Aquila_VERSION_SUFFIX "-dev")
set(Aquila_VERSION "${Aquila_VERSION_MAJOR}.${Aquila_VERSION_MINOR}.${Aquila_VERSION_PATCH}${Aquila_VERSION_SUFFIX}")
################################################################################
#
# Build options
#
################################################################################
option(Aquila_BUILD_EXAMPLES "Build example programs?" ON)
option(Aquila_BUILD_TESTS "Build test programs?" ON)
################################################################################
#
# Dependencies
#
################################################################################
# libraries bundled with Aquila
add_subdirectory(lib)
set(Aquila_LIBRARIES_TO_LINK_WITH Ooura_fft)
# additional CMake modules
set(CMAKE_MODULE_PATH "${Aquila_SOURCE_DIR}/cmake")
################################################################################
#
# Aquila sources
#
################################################################################
# library headers
set(Aquila_HEADERS
aquila/aquila.h
aquila/global.h
aquila/functions.h
aquila/Exceptions.h
aquila/source.h
aquila/tools.h
aquila/transform.h
aquila/filter.h
aquila/ml.h
aquila/filter/MelFilter.h
aquila/filter/MelFilterBank.h
aquila/ml/DtwPoint.h
aquila/ml/Dtw.h
aquila/source/SignalSource.h
aquila/source/Frame.h
aquila/source/FramesCollection.h
aquila/source/PlainTextFile.h
aquila/source/RawPcmFile.h
aquila/source/WaveFile.h
aquila/source/WaveFileHandler.h
aquila/source/generator/Generator.h
aquila/source/generator/SineGenerator.h
aquila/source/generator/SquareGenerator.h
aquila/source/generator/TriangleGenerator.h
aquila/source/generator/PinkNoiseGenerator.h
aquila/source/generator/WhiteNoiseGenerator.h
aquila/source/window/BarlettWindow.h
aquila/source/window/BlackmanWindow.h
aquila/source/window/FlattopWindow.h
aquila/source/window/GaussianWindow.h
aquila/source/window/HammingWindow.h
aquila/source/window/HannWindow.h
aquila/source/window/RectangularWindow.h
aquila/transform/Fft.h
aquila/transform/Dft.h
aquila/transform/AquilaFft.h
aquila/transform/OouraFft.h
aquila/transform/FftFactory.h
aquila/transform/Dct.h
aquila/transform/Mfcc.h
aquila/transform/Spectrogram.h
aquila/tools/TextPlot.h
)
# library sources
set(Aquila_SOURCES
aquila/filter/MelFilter.cpp
aquila/filter/MelFilterBank.cpp
aquila/ml/Dtw.cpp
aquila/source/SignalSource.cpp
aquila/source/Frame.cpp
aquila/source/FramesCollection.cpp
aquila/source/PlainTextFile.cpp
aquila/source/WaveFile.cpp
aquila/source/WaveFileHandler.cpp
aquila/source/generator/Generator.cpp
aquila/source/generator/SineGenerator.cpp
aquila/source/generator/SquareGenerator.cpp
aquila/source/generator/TriangleGenerator.cpp
aquila/source/generator/PinkNoiseGenerator.cpp
aquila/source/generator/WhiteNoiseGenerator.cpp
aquila/source/window/BarlettWindow.cpp
aquila/source/window/BlackmanWindow.cpp
aquila/source/window/FlattopWindow.cpp
aquila/source/window/GaussianWindow.cpp
aquila/source/window/HammingWindow.cpp
aquila/source/window/HannWindow.cpp
aquila/transform/Dft.cpp
aquila/transform/AquilaFft.cpp
aquila/transform/OouraFft.cpp
aquila/transform/FftFactory.cpp
aquila/transform/Dct.cpp
aquila/transform/Mfcc.cpp
aquila/transform/Spectrogram.cpp
aquila/tools/TextPlot.cpp
)
################################################################################
#
# Compiler-specific workarounds
#
################################################################################
if(MSVC)
# disable "strncpy is deprecated" warning and enable math constants
add_definitions("/D_CRT_NONSTDC_NO_DEPRECATE /D_USE_MATH_DEFINES")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif()
# if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -Wall -Wextra -Wcast-qual -Wcast-align -Wno-unused-parameter -Wmissing-include-dirs -Wpointer-arith -Wredundant-decls -Wshadow")
# endif()
################################################################################
#
# Building and linking
#
################################################################################
# main Aquila library
add_library(Aquila ${Aquila_HEADERS} ${Aquila_SOURCES})
# linking with extra libs
target_link_libraries(Aquila ${Aquila_LIBRARIES_TO_LINK_WITH})
# examples
if(Aquila_BUILD_EXAMPLES)
add_custom_target(examples)
add_subdirectory(examples)
endif()
#tests
if(Aquila_BUILD_TESTS)
enable_testing()
set(UNITTESTPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/unittestpp/")
add_subdirectory(tests)
endif()
################################################################################
#
# Installing
#
################################################################################
# install the binaries and include files
install(TARGETS Aquila
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(DIRECTORY aquila/ DESTINATION include/aquila FILES_MATCHING PATTERN "*.h")
install(FILES CHANGELOG LICENSE README.md DESTINATION share/aquila)
################################################################################
#
# Uninstalling
#
################################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
)