-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
83 lines (64 loc) · 1.5 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
cmake_minimum_required(VERSION 3.1)
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
project("OSS Proxy"
VERSION 1.3.3
DESCRIPTION "Emulate OSS device(s) using CUSE."
HOMEPAGE_URL "https://github.com/OpenMandrivaSoftware/ossp"
LANGUAGES "C"
)
option(alsa "Build ALSA slave." OFF)
option(daemon "Build daemon." ON)
option(pulseaudio "Build PulseAudio slave." ON)
option(test "Build test." OFF)
include(ossp-util)
if(test)
include(CTest)
endif()
# Shared library
add_library(libossp OBJECT
"ossp.c"
"ossp.h"
"ossp-slave.c"
"ossp-slave.h"
"ossp-util.c"
"ossp-util.h"
)
target_compile_definitions(libossp
PUBLIC
"OSSP_VERSION=\"${PROJECT_VERSION}\""
)
# Daemon
if(daemon)
add_executable(osspd "osspd.c")
set_output_dir(osspd)
link_pkg(osspd "fuse3")
target_link_libraries(osspd PRIVATE libossp)
install_daemon(osspd)
endif()
# ALSA slave
if(alsa)
add_executable(ossp-alsap "ossp-alsap.c")
set_output_dir(ossp-alsap)
link_pkg(ossp-alsap "alsa")
target_link_libraries(ossp-alsap PRIVATE libossp)
install_slave(ossp-alsap)
endif()
# PulseAudio slave
if(pulseaudio)
add_executable(ossp-padsp "ossp-padsp.c")
set_output_dir(ossp-padsp)
link_pkg(ossp-padsp "libpulse")
target_link_libraries(ossp-padsp PRIVATE libossp)
install_slave(ossp-padsp)
endif()
if(test)
add_executable(osstest "osstest.c")
add_test(
NAME osstest
COMMAND osstest
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
endif()
install_udev_rules("98-osscuse.rules")