forked from tinyalsa/tinyalsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (44 loc) · 1.56 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
cmake_minimum_required(VERSION 3.0.2)
project("TinyALSA" C)
set (HDRS
"include/tinyalsa/attributes.h"
"include/tinyalsa/version.h"
"include/tinyalsa/asoundlib.h"
"include/tinyalsa/pcm.h"
"include/tinyalsa/mixer.h")
set (SRCS
"src/pcm.c"
"src/mixer.c")
set(CMAKE_EXE_LINKER_FLAGS "-static")
add_library("tinyalsa" ${HDRS} ${SRCS})
target_compile_options("tinyalsa" PRIVATE -Wall -Wextra -Wfatal-errors)
target_include_directories("tinyalsa" PRIVATE "include")
macro(ADD_EXAMPLE EXAMPLE)
add_executable(${EXAMPLE} ${ARGN})
target_link_libraries(${EXAMPLE} "tinyalsa")
target_include_directories(${EXAMPLE} PRIVATE "include")
endmacro(ADD_EXAMPLE EXAMPLE)
add_example("pcm-readi" "examples/pcm-readi.c")
add_example("pcm-writei" "examples/pcm-writei.c")
find_package(Threads)
target_link_libraries (${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT})
macro(ADD_UTIL UTIL)
add_executable(${UTIL} ${ARGN})
target_link_libraries(${UTIL} "tinyalsa")
target_compile_options(${UTIL} PRIVATE -Wall -Wextra -Wfatal-errors)
target_include_directories(${UTIL} PRIVATE "include")
endmacro(ADD_UTIL UTIL)
add_util("tinyplay" "utils/tinyplay.c")
add_util("tinycap" "utils/tinycap.c")
add_util("tinypcminfo" "utils/tinypcminfo.c")
add_util("tinymix" "utils/tinymix.c")
install(FILES ${HDRS}
DESTINATION "include/tinyalsa")
install(TARGETS "tinyalsa"
"tinyplay"
"tinycap"
"tinymix"
"tinypcminfo"
RUNTIME DESTINATION "bin"
ARCHIVE DESTINATION "lib"
LIBRARY DESTINATION "lib")