-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (53 loc) · 1.66 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
#cmake command: cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake_minimum_required(VERSION 3.10)
# Define the project name and version
project(cppdub VERSION 1.0 LANGUAGES CXX)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Define the include directories
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/lib/ffmpeg/include
${PROJECT_SOURCE_DIR}/lib/portaudio/include
${PROJECT_SOURCE_DIR}/lib/json-develop/include
)
# Define the source files
set(SOURCES
src/audio_segment.cpp
src/cppaudioop.cpp
src/effects.cpp
src/exceptions.cpp
src/generators.cpp
src/logging_utils.cpp
src/playback.cpp
src/silence.cpp
src/utils.cpp
)
# Create the library
add_library(cppdub STATIC ${SOURCES})
# Define the libraries to link against
find_library(FFMPEG_LIBRARIES
NAMES avcodec avdevice avfilter avformat avutil postproc swresample swscale
PATHS ${PROJECT_SOURCE_DIR}/lib/ffmpeg/lib
)
find_library(PORTAUDIO_LIBRARIES
NAMES portaudio
PATHS ${PROJECT_SOURCE_DIR}/lib/portaudio/lib
)
# Link the libraries to the cppdub library
target_link_libraries(cppdub
PRIVATE
${FFMPEG_LIBRARIES}
${PORTAUDIO_LIBRARIES}
)
# Specify the output directory for the built library
set_target_properties(cppdub PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
)
# Optionally: Create an install target
install(TARGETS cppdub DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
# Optionally: Add a target for testing or examples
# add_subdirectory(tests)
# add_subdirectory(examples)