forked from i-rinat/apulse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (56 loc) · 2.27 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
project(apulse)
cmake_minimum_required (VERSION 2.8)
add_definitions(-std=gnu99 -Wall -fPIC -fvisibility=hidden)
add_definitions(-Werror=implicit-function-declaration)
find_package(PkgConfig REQUIRED)
pkg_check_modules(REQ glib-2.0 alsa REQUIRED)
# enable tracing for Debug builds
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DWITH_TRACE")
# link with pthread
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
include_directories(${REQ_INCLUDE_DIRS})
set(USE_BUNDLED_PULSEAUDIO_HEADERS 1 CACHE BOOLEAN "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-context.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/util.c
src/ringbuffer.c
src/notimplemented.c
)
add_library(pulse-simple SHARED
src/apulse-simple.c
)
add_library(pulsecommon-5.0 SHARED
src/apulse-common.c
)
set_target_properties(pulse PROPERTIES VERSION 0)
set_target_properties(pulse-simple PROPERTIES VERSION 0)
set(SYMBOLMAP "-Wl,-version-script=\"${CMAKE_SOURCE_DIR}/src/symbolmap\"")
target_link_libraries(pulse ${SYMBOLMAP} trace-helper ${REQ_LIBRARIES})
target_link_libraries(pulse-simple ${SYMBOLMAP} trace-helper ${REQ_LIBRARIES})
target_link_libraries(pulsecommon-5.0 ${SYMBOLMAP} trace-helper ${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 pulsecommon-5.0 pulse DESTINATION "${APULSEPATH}")