forked from extemporelang/portmidi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (65 loc) · 1.65 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
cmake_minimum_required(VERSION 3.1) # we use target_sources()
############
# portmidi #
############
add_library(portmidi STATIC
pm_common/portmidi.c
pm_common/pmutil.c
porttime/porttime.c
)
target_include_directories(portmidi
PRIVATE pm_common
PRIVATE porttime
)
# platform-specific
if(APPLE)
target_sources(portmidi
PRIVATE porttime/ptmacosx_mach.c
PRIVATE pm_mac/finddefault.c
PRIVATE pm_mac/pmmac.c
PRIVATE pm_mac/pmmacosxcm.c
PRIVATE pm_mac/readbinaryplist.c
)
target_include_directories(portmidi
PRIVATE pm_mac
)
target_link_libraries(portmidi
PRIVATE "-framework CoreFoundation"
PRIVATE "-framework CoreAudio"
PRIVATE "-framework CoreMIDI"
PRIVATE "-framework Carbon" # for readbinaryplist.c
)
target_compile_options(portmidi
PRIVATE -Wno-deprecated-declarations)
elseif(UNIX AND NOT APPLE)
target_sources(portmidi
PRIVATE porttime/ptlinux.c
PRIVATE pm_linux/finddefault.c
PRIVATE pm_linux/pmlinux.c
PRIVATE pm_linux/pmlinuxalsa.c
)
target_include_directories(portmidi
PRIVATE pm_linux
)
target_compile_definitions(portmidi
PRIVATE -DPMALSA)
target_compile_options(portmidi
PRIVATE -Wno-deprecated-declarations)
elseif(WIN32)
target_sources(portmidi
PRIVATE porttime/ptwinmm.c
PRIVATE pm_win/pmwin.c
PRIVATE pm_win/pmwinmm.c
)
target_include_directories(portmidi
PRIVATE pm_win
)
target_compile_definitions(portmidi
PRIVATE -DWIN32)
target_link_libraries(portmidi
PRIVATE winmm)
endif()
install(TARGETS portmidi
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib # for .lib files on Windows
LIBRARY DESTINATION lib)