-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
108 lines (96 loc) · 3.12 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
project(sfAudio)
cmake_minimum_required(VERSION 3.1)
get_filename_component(SFAUDIO_ROOT "./" ABSOLUTE)
if (NOT DEFINED AR)
message("[sfAudio]: Architecture is not set, defaulting to x86")
set(AR x86)
endif()
add_definitions(-DFLAC__NO_DLL)
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS) # avoids warnings in vorbisfile.h
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(LIB_SUFFX -d)
endif()
if (MSVC)
set(SFAUDIO_EXT_LIBS
${SFAUDIO_ROOT}/external/libs-msvc2015/${AR}/flac.lib
${SFAUDIO_ROOT}/external/libs-msvc2015/${AR}/libogg${LIB_SUFFX}.lib
${SFAUDIO_ROOT}/external/libs-msvc2015/${AR}/openal32.lib
${SFAUDIO_ROOT}/external/libs-msvc2015/${AR}/libvorbis${LIB_SUFFX}.lib
${SFAUDIO_ROOT}/external/libs-msvc2015/${AR}/libvorbisfile${LIB_SUFFX}.lib
CACHE LIST "Set the list of libs paths for sfAudio"
)
else()
message(FATAL_ERROR "Current compiler is not supported. Exiting.")
endif(MSVC)
set(SFAUDIO_INC
${SFAUDIO_ROOT}/external/headers/
${SFAUDIO_ROOT}/include
CACHE LIST "Set the list of include paths for sfAudio"
)
include_directories(
${SFAUDIO_ROOT}/external/headers/
${SFAUDIO_ROOT}/include
)
set(SFAUDIO_SRC
src/System/FileInputStream.cpp
src/System/MemoryInputStream.cpp
src/System/Time.cpp
src/ALCheck.cpp
src/AlResource.cpp
src/AudioDevice.cpp
src/InputSoundFile.cpp
src/Listener.cpp
src/Music.cpp
src/OutputSoundFile.cpp
src/Sound.cpp
src/SoundBuffer.cpp
src/SoundBufferRecorder.cpp
src/SoundFileFactory.cpp
src/SoundFileReaderFlac.cpp
src/SoundFileReaderOgg.cpp
src/SoundFileReaderWav.cpp
src/SoundFileWriterFlac.cpp
src/SoundFileWriterOgg.cpp
src/SoundFileWriterWav.cpp
src/SoundRecorder.cpp
src/SoundSource.cpp
src/SoundStream.cpp
)
set(SFAUDIO_HEADERS
include/sfAudio/System/FileInputStream.hpp
include/sfAudio/System/InputStream.hpp
include/sfAudio/System/MemoryInputStream.hpp
include/sfAudio/System/Vector3.h
include/sfAudio/System/Time.hpp
include/sfAudio/ALCheck.hpp
include/sfAudio/AlResource.hpp
include/sfAudio/AudioDevice.hpp
include/sfAudio/InputSoundFile.hpp
include/sfAudio/Listener.hpp
include/sfAudio/Music.hpp
include/sfAudio/OutputSoundFile.hpp
include/sfAudio/Sound.hpp
include/sfAudio/SoundBuffer.hpp
include/sfAudio/SoundBufferRecorder.hpp
include/sfAudio/SoundFileFactory.hpp
include/sfAudio/SoundFileReader.hpp
include/sfAudio/SoundFileReaderFlac.hpp
include/sfAudio/SoundFileReaderOgg.hpp
include/sfAudio/SoundFileReaderWav.hpp
include/sfAudio/SoundFileWriter.hpp
include/sfAudio/SoundFileWriterFlac.hpp
include/sfAudio/SoundFileWriterOgg.hpp
include/sfAudio/SoundFileWriterWav.hpp
include/sfAudio/SoundRecorder.hpp
include/sfAudio/SoundSource.hpp
include/sfAudio/SoundStream.hpp
include/sfAudio/SoundFileFactory.inl
)
add_library(sfAudio STATIC
${SFAUDIO_SRC}
)
set_target_properties(sfAudio
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)