forked from ggerganov/kbd-audio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
112 lines (84 loc) · 2.89 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
cmake_minimum_required (VERSION 2.8)
project (KBD-Audio)
set(CMAKE_EXPORT_COMPILE_COMMANDS "on")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "DEBUG" "RELEASE" "RELWITHDEBINFO")
endif()
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Threads REQUIRED)
find_package(SDL2 REQUIRED)
find_package(FFTW REQUIRED)
find_package(OpenGL REQUIRED)
string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES)
if (APPLE)
find_library(COREGRAPHICS_LIBRARY CoreGraphics )
find_library(COREFOUNDATION_LIBRARY CoreFoundation )
else (APPLE)
unset(COREGRAPHICS_LIBRARY)
unset(COREFOUNDATION_LIBRARY)
endif (APPLE)
include_directories(imgui)
include_directories(imgui/examples)
include_directories(imgui/examples/libs/gl3w)
include_directories(${SDL2_INCLUDE_DIRS})
add_library(Core STATIC
audio_logger.cpp
)
target_include_directories(Core PRIVATE
${FFTW_INCLUDE_DIRS}
)
target_link_libraries(Core PRIVATE
${CMAKE_THREAD_LIBS_INIT}
${SDL2_LIBRARIES}
${FFTWF_LIBRARIES}
${COREFOUNDATION_LIBRARY}
)
add_library(ImGui STATIC
imgui/imgui.cpp
imgui/imgui_draw.cpp
imgui/imgui_demo.cpp
imgui/imgui_widgets.cpp
imgui/examples/libs/gl3w/GL/gl3w.c
imgui/examples/imgui_impl_sdl.cpp
imgui/examples/imgui_impl_opengl3.cpp
)
target_compile_definitions(ImGui PRIVATE
IMGUI_USER_CONFIG="../imconfig-vtx32.h"
)
target_link_libraries(ImGui PRIVATE
${CMAKE_DL_LIBS}
${SDL2_LIBRARIES}
${OPENGL_LIBRARIES}
${COREFOUNDATION_LIBRARY}
)
add_executable(key_average_gui key_average_gui.cpp)
target_link_libraries(key_average_gui PRIVATE Core ImGui)
add_executable(guess_qp guess_qp.cpp)
target_link_libraries(guess_qp PRIVATE Core)
add_executable(guess_qp2 guess_qp2.cpp)
target_link_libraries(guess_qp2 PRIVATE Core)
add_executable(keytap keytap.cpp)
target_link_libraries(keytap PRIVATE Core)
add_executable(keytap2 keytap2.cpp)
target_link_libraries(keytap2 PRIVATE Core)
add_executable(keytap-gui keytap-gui.cpp)
target_link_libraries(keytap-gui PRIVATE Core ImGui)
add_executable(keytap2-gui keytap2-gui.cpp)
target_link_libraries(keytap2-gui PRIVATE Core ImGui)
add_executable(key_detector key_detector.cpp)
target_link_libraries(key_detector PRIVATE Core)
add_executable(play play.cpp)
target_link_libraries(play PRIVATE Core)
add_executable(play-full play-full.cpp)
target_link_libraries(play-full PRIVATE Core)
add_executable(scale scale.cpp)
target_link_libraries(scale PRIVATE Core)
add_executable(record record.cpp)
target_link_libraries(record PRIVATE Core)
add_executable(record-full record-full.cpp)
target_link_libraries(record-full PRIVATE Core)
add_executable(subbreak subbreak.cpp)
target_link_libraries(subbreak PRIVATE Core)