generated from kooBH/Signal-Processing-testbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (55 loc) · 1.3 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
# CMAKE version of Ubuntu 16.04 LTS is 3.5.
cmake_minimum_required(VERSION 3.5)
project(test)
set(LINKLIBS)
set(COMPILE_OPTION)
set(SRC)
set(INCL)
include(${CMAKE_CURRENT_LIST_DIR}/lib/RtAudioWrapper/RtAudio.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/lib/WAV/WAV.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/lib/STFT/cpp/STFT_cpp.cmake)
if(NOT MSVC)
list(APPEND LINKLIBS
# <math.h>
m
# openMP
-fopenmp
)
else()
list(APPEND LINKLIBS
)
endif()
list(APPEND SRC
test.cpp
# TODO : Add path to algorithm source here.
)
list(APPEND INCL
src
lib/STFT/cpp
lib/WAV
)
if(NOT MSVC)
list(APPEND COMPILE_OPTION
# openMP
-fopenmp
# debugging
-g
# -O3 : maximize performace
# -O2 : maximize performance as long as not increasing size of executable
# -O1 : minimize compile time and others are secondary
# -Os : minimize size of executable
-O3
)
else()
list(APPEND COMPILE_OPTION
# Visual Studio uses '/' for compile option
/openmp
# /MP - compiled in mult-process : faster build time
/MP
)
endif()
add_executable(${PROJECT_NAME} ${SRC})
target_include_directories(${PROJECT_NAME} PRIVATE ${INCL} )
target_link_libraries(${PROJECT_NAME} ${LINKLIBS})
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTION} )
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 )