forked from RuiChen0101/linux_audio_decoder_and_player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (38 loc) · 1.14 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(INC_LIST
"include/decoder/decoder.h"
"include/decoder/ffmpeg_decoder.h"
"include/decoder/pcm_reader.h"
"include/player/player.h"
"include/player/alsa_player.h"
"include/player/pcm_dumper.h"
)
set(SRC_LIST
"src/decoder/decoder.cpp"
"src/decoder/ffmpeg_decoder.cpp"
"src/decoder/pcm_reader.cpp"
"src/player/player.cpp"
"src/player/alsa_player.cpp"
"src/player/pcm_dumper.cpp"
"main.cpp"
)
set(LIB_LIST
"-lasound"
"-lavformat"
"-lavcodec"
"-lavutil"
"-lswresample"
)
set(COMPILE_OPTION -std=c++17 -Wfatal-errors)
include_directories("./")
include_directories("./include")
include_directories("/usr/include")
link_directories("/usr/lib")
#build main
set(MAIN_TARGET decode_and_play)
add_executable(${MAIN_TARGET} ${SRC_LIST} ${INC_LIST})
target_compile_options(${MAIN_TARGET} PUBLIC ${COMPILE_OPTION})
target_link_libraries(${MAIN_TARGET} PUBLIC ${LIB_LIST})