-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (51 loc) · 1.86 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
cmake_minimum_required(VERSION 3.10)
project(jmp123)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W3 /permissive-")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fsanitize=undefined")
endif ()
set(COMMON_SOURCE
output/output.cc output/output.h playback.cc playback.h
decoder/audio_buffer.cc
decoder/audio_buffer.h
decoder/bit_stream.cc
decoder/bit_stream.h
decoder/header.cc
decoder/header.h
decoder/tables.cc
decoder/tables.h
decoder/layer_1.cc
decoder/layer_1.h
decoder/layer123.cc
decoder/layer123.h
decoder/synthesis.cc
decoder/synthesis.h
decoder/layer_2.cc decoder/layer_2.h
decoder/layer_3.cc decoder/layer_3.h
decoder/synthesis_concurrent.cc decoder/synthesis_concurrent.h
decoder/bit_stream_main_data.cc decoder/bit_stream_main_data.h)
add_executable(jmp123 main.cc ${COMMON_SOURCE})
target_include_directories(jmp123 PUBLIC .)
target_link_libraries(jmp123 libjmp123)
add_library(libjmp123 ${COMMON_SOURCE})
target_include_directories(libjmp123 PUBLIC .)
# link pThread
find_package(Threads)
target_link_libraries(libjmp123 ${CMAKE_THREAD_LIBS_INIT})
# fmt library
add_subdirectory(third_party/fmt)
target_include_directories(libjmp123 PUBLIC third_party/fmt/include)
target_link_libraries(libjmp123 fmt)
# portaudio library
#set(PA_USE_ALSA ON)
#set(PA_USE_JACK OFF)
add_subdirectory(third_party/port_audio)
target_include_directories(libjmp123 PUBLIC third_party/port_audio/include)
target_link_libraries(libjmp123 PortAudio)
# config.h
set(PROJECT_PATH ${CMAKE_CURRENT_LIST_DIR})
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
target_include_directories(jmp123 PUBLIC ${CMAKE_CURRENT_BINARY_DIR})