-
Notifications
You must be signed in to change notification settings - Fork 35
/
CMakeLists.txt
84 lines (65 loc) · 2.79 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
project(apulse)
cmake_minimum_required (VERSION 2.8)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -fPIC -fvisibility=hidden")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
find_package(PkgConfig REQUIRED)
pkg_check_modules(REQ glib-2.0 alsa REQUIRED)
list(APPEND REQ_LIBRARIES m)
set(WITH_TRACE 0 CACHE STRING "trace level: no tracing (0) / unimplemented only (1) / all (2)")
set(LOG_TO_STDERR 0 CACHE STRING "send all log output to stderr")
# Options.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCONFIG_TRACE_LEVEL=${WITH_TRACE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCONFIG_LOG_TO_STDERR=${LOG_TO_STDERR}")
include_directories(${REQ_INCLUDE_DIRS})
set(USE_BUNDLED_PULSEAUDIO_HEADERS 1 CACHE BOOL "Use bundled PulseAudio headers instead of system ones")
if (${USE_BUNDLED_PULSEAUDIO_HEADERS})
include_directories(3rdparty/pulseaudio-headers)
else()
pkg_check_modules(PA libpulse>=5.0 REQUIRED)
include_directories(${PA_INCLUDE_DIRECTORIES})
endif()
link_directories(${REQ_LIBRARY_DIRS})
add_library(trace-helper STATIC
src/trace.c
)
add_library(pulse SHARED
src/apulse-channel-map.c
src/apulse-common.c
src/apulse-context.c
src/apulse-ext.c
src/apulse-format-info.c
src/apulse-mainloop.c
src/apulse-misc.c
src/apulse-operation.c
src/apulse-proplist.c
src/apulse-signal.c
src/apulse-stream.c
src/apulse-threaded-mainloop.c
src/apulse-volume.c
src/ringbuffer.c
src/util.c
)
add_library(pulse-simple SHARED
src/apulse-simple.c
)
add_library(pulse-mainloop-glib SHARED
src/apulse-mainloop-glib.c
)
set_target_properties(pulse PROPERTIES VERSION 0)
set_target_properties(pulse-mainloop-glib PROPERTIES VERSION 0)
set_target_properties(pulse-simple PROPERTIES VERSION 0)
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -Wl,-version-script=\"${CMAKE_SOURCE_DIR}/src/symbolmap\"")
target_link_libraries(pulse trace-helper ${REQ_LIBRARIES})
target_link_libraries(pulse-mainloop-glib trace-helper pulse ${REQ_LIBRARIES})
target_link_libraries(pulse-simple trace-helper pulse ${REQ_LIBRARIES})
add_subdirectory(tests)
set(APULSEPATH "${CMAKE_INSTALL_PREFIX}/lib/apulse" CACHE PATH "library installation directory")
set(APULSE_SEARCH_PATHS "${APULSEPATH}" CACHE PATH "directory list for LD_LIBRARY_PATH")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/apulse.template"
"${CMAKE_CURRENT_BINARY_DIR}/apulse" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apulse" DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(TARGETS pulse-simple pulse pulse-mainloop-glib DESTINATION "${APULSEPATH}")
install(FILES "${CMAKE_SOURCE_DIR}/man/apulse.1" DESTINATION share/man/man1)