-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
97 lines (77 loc) · 4.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
91
92
93
94
95
96
97
cmake_minimum_required(VERSION 3.5)
project(deep-beep LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SOURCES pipeline.cpp data.cpp)
set(GUI_SOURCES main.cpp musicplayer.cpp musicreader.cpp qml.qrc)
find_package(Qt5 COMPONENTS Core Quick Multimedia REQUIRED)
find_package(OpenCV REQUIRED)
# disable as many options as possible for fluidsynth
set(enable-aufile "compile support for sound file output" off)
set(BUILD_SHARED_LIBS "Build a shared object or DLL" on)
set(enable-dbus "compile DBUS support (if it is available)" off)
set(enable-ipv6 "enable ipv6 support" off)
set(enable-jack "compile JACK support (if it is available)" off)
set(enable-ladspa "enable LADSPA effect units" off)
set(enable-libinstpatch "use libinstpatch (if available) to load DLS and GIG files" off)
set(enable-libsndfile "compile libsndfile support (if it is available)" off)
set(enable-midishare "compile MidiShare support (if it is available)" off)
set(enable-opensles "compile OpenSLES support (if it is available)" off)
set(enable-oboe "compile Oboe support (requires OpenSLES and/or AAudio)" off)
set(enable-network "enable network support (requires BSD sockets)" off)
set(enable-oss "compile OSS support (if it is available)" off)
set(enable-dsound "compile DirectSound support (if it is available)" off)
set(enable-waveout "compile Windows WaveOut support (if it is available)" off)
set(enable-winmidi "compile Windows MIDI support (if it is available)" off)
set(enable-sdl2 "compile SDL2 audio support (if it is available)" off)
set(enable-pkgconfig "use pkg-config to locate fluidsynth's (mostly optional) dependencies" on)
set(enable-pulseaudio "compile PulseAudio support (if it is available)" on)
set(enable-readline "compile readline lib line editing (if it is available)" off)
set(enable-threads "enable multi-threading support (such as parallel voice synthesis)" off)
# linux specific
set(enable-lash "compile LASH support (if it is available)" off)
set(enable-alsa "compile ALSA support (if it is available)" off)
set(enable-systemd "compile systemd support (if it is available)" off)
# dawin (apple) specific
set(enable-coreaudio "compile CoreAudio support (if it is available)" off)
set(enable-coremidi "compile CoreMIDI support (if it is available)" off)
set(enable-framework "create a Mac OSX style FluidSynth.framework" off)
# OS2
set(enable-dart "compile DART support (if it is available)" off)
# this is required for fluidsynth to link to glib
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(lib/fluidsynth)
configure_file("assets/Grand Piano.sf2" "assets/Grand Piano.sf2" COPYONLY)
configure_file(assets/note-template.png assets/note-template.png COPYONLY)
if(ANDROID)
add_library(deep-beep SHARED ${GUI_SOURCES} ${SOURCES})
else()
add_executable(deep-beep ${GUI_SOURCES} ${SOURCES})
add_executable(imgproc imgproc.cpp ${SOURCES})
endif()
link_directories(lib/fluidsynth/src)
target_compile_definitions(deep-beep
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(deep-beep
PRIVATE Qt5::Core Qt5::Quick Qt5::Multimedia ${OpenCV_LIBS} libfluidsynth)
target_link_libraries(imgproc ${OpenCV_LIBS})
# give us newer c++ features
set_property(TARGET deep-beep PROPERTY CXX_STANDARD 14)
set_property(TARGET imgproc PROPERTY CXX_STANDARD 14)
set_property(TARGET deep-beep PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET imgproc PROPERTY CXX_STANDARD_REQUIRED ON)
target_include_directories(deep-beep PRIVATE lib/fluidsynth/include)
target_include_directories(deep-beep PRIVATE ${CMAKE_BINARY_DIR}/include)
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check http://doc.qt.io/qt-5/deployment-android.html for more information.
# These variables must use CACHE, otherwise QtCreator won't see them.
#if(ANDROID)
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android" CACHE INTERNAL "")
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
# set(ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so CACHE INTERNAL "")
# endif()
#endif()