-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
80 lines (68 loc) · 2.35 KB
/
CMakeLists.txt
File metadata and controls
80 lines (68 loc) · 2.35 KB
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
cmake_minimum_required(VERSION 3.16)
project(WaveShaper VERSION 1.0.0 LANGUAGES CXX)
# C++ Standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# --- GLFW via FetchContent ---
include(FetchContent)
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.4
)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(glfw)
# --- RtMidi — compiled directly from source ---
add_library(rtmidi STATIC vendor/rtmidi/RtMidi.cpp)
target_include_directories(rtmidi PUBLIC vendor/rtmidi)
if(WIN32)
target_compile_definitions(rtmidi PUBLIC __WINDOWS_MM__)
target_link_libraries(rtmidi PUBLIC winmm)
elseif(APPLE)
target_compile_definitions(rtmidi PUBLIC __MACOSX_CORE__)
target_link_libraries(rtmidi PUBLIC "-framework CoreMIDI" "-framework CoreAudio" "-framework CoreFoundation")
elseif(UNIX)
target_compile_definitions(rtmidi PUBLIC __LINUX_ALSA__)
target_link_libraries(rtmidi PUBLIC asound pthread)
endif()
# --- Steinberg VST3 SDK ---
set(SMTG_ENABLE_VST3_HOSTING_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SMTG_ENABLE_VST3_PLUGIN_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SMTG_ENABLE_VSTGUI_SUPPORT OFF CACHE BOOL "" FORCE)
set(SMTG_ADD_VSTGUI OFF CACHE BOOL "" FORCE)
set(SMTG_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(vendor/vst3sdk)
# --- shine MP3 encoder ---
add_library(shine STATIC
vendor/shine/layer3.c
vendor/shine/bitstream.c
vendor/shine/huffman.c
vendor/shine/l3bitstream.c
vendor/shine/l3loop.c
vendor/shine/l3mdct.c
vendor/shine/l3subband.c
vendor/shine/reservoir.c
vendor/shine/tables.c
)
target_include_directories(shine PUBLIC vendor/shine)
if(MSVC)
target_compile_options(shine PRIVATE /wd4244 /wd4267 /wd4146)
target_compile_definitions(shine PRIVATE __attribute__\(x\)=)
endif()
# Add subdirectories
add_subdirectory(src)
# Tests
enable_testing()
add_subdirectory(tests)
# Compiler flags
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)