-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
136 lines (129 loc) · 3.55 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
cmake_minimum_required(VERSION 3.10)
project("PortAMP")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_definitions(
-DMODPLUG_STATIC
-DFLAC__NO_DLL
)
include_directories(
.
src
src/OpenAL
libs
libs/libogg-1.3.2/include
libs/libvorbis-1.3.5/include
libs/libmodplug-0.8.8.5/src
libs/id3v2lib/include
libs/flac-1.3.3/include
libs/monkey-audio
libs/libopus/include
libs/libopusfile/include
)
set(SRC_FILES
src/main.cpp
src/AudioSubsystem_OpenAL.cpp
src/Decoders/iWaveDataProvider.cpp
src/Decoders/WAV/WAVDataProvider.cpp
src/Decoders/MP3/MP3DataProvider.cpp
src/Decoders/OGG/OGGDataProvider.cpp
src/Decoders/ModPlug/ModPlugDataProvider.cpp
src/Decoders/FLAC/FLACDataProvider.cpp
src/Decoders/APE/APEDataProvider.cpp
src/Decoders/Opus/OpusDataProvider.cpp
src/Encoders/WAV/WAVDataEncoder.cpp
src/OpenAL/LAL.cpp
src/Utils.cpp
)
set(HEADER_FILES
src/AudioSubsystem.h
src/AudioSubsystem_OpenAL.h
src/Decoders/iWaveDataProvider.h
src/Decoders/WAV/WAVDataProvider.h
src/Decoders/MP3/MP3DataProvider.h
src/Decoders/OGG/OGGDataProvider.h
src/Decoders/ModPlug/ModPlugDataProvider.h
src/Decoders/FLAC/FLACDataProvider.h
src/Decoders/APE/APEDataProvider.h
src/Decoders/Opus/OpusDataProvider.h
src/Encoders/iWaveDataEncoder.h
src/Encoders/WAV/WAVDataEncoder.h
src/OpenAL/LAL.h
src/Utils.h
)
add_executable(portamp
${SRC_FILES}
${HEADER_FILES}
)
if(MSVC)
add_subdirectory(libs/libogg-1.3.2 EXCLUDE_FROM_ALL)
add_subdirectory(libs/libvorbis-1.3.5 EXCLUDE_FROM_ALL)
add_subdirectory(libs/libmodplug-0.8.8.5 EXCLUDE_FROM_ALL)
add_subdirectory(libs/id3v2lib EXCLUDE_FROM_ALL)
add_subdirectory(libs/flac-1.3.3 EXCLUDE_FROM_ALL)
add_subdirectory(libs/monkey-audio EXCLUDE_FROM_ALL)
add_subdirectory(libs/libopus EXCLUDE_FROM_ALL)
add_subdirectory(libs/libopusfile EXCLUDE_FROM_ALL)
# set(CMAKE_C_FLAGS "/EHsc /RTCc /RTC1 /MTd /Zp16 /GS /Qpar /MP /wd4244")
# set(CMAKE_CXX_FLAGS "/EHsc /RTCc /RTC1 /MTd /Zp16 /GS /Qpar /MP /wd4244")
# add_definitions(-D_ALLOW_RTCc_IN_STL)
target_link_libraries(portamp
libogg
libvorbis
libmodplug
id3v2
libflac
monkeyaudio
libopus
libopusfile
)
set_property(TARGET libogg PROPERTY FOLDER ThirdParty)
set_property(TARGET libvorbis PROPERTY FOLDER ThirdParty)
set_property(TARGET libmodplug PROPERTY FOLDER ThirdParty)
set_property(TARGET libflac PROPERTY FOLDER ThirdParty)
set_property(TARGET id3v2 PROPERTY FOLDER ThirdParty)
set_property(TARGET monkeyaudio PROPERTY FOLDER ThirdParty)
set_property(TARGET libopus PROPERTY FOLDER ThirdParty)
set_property(TARGET libopusfile PROPERTY FOLDER ThirdParty)
elseif(APPLE)
add_subdirectory(libs/libogg-1.3.2 EXCLUDE_FROM_ALL)
add_subdirectory(libs/libvorbis-1.3.5 EXCLUDE_FROM_ALL)
add_subdirectory(libs/libmodplug-0.8.8.5 EXCLUDE_FROM_ALL)
add_subdirectory(libs/id3v2lib EXCLUDE_FROM_ALL)
add_subdirectory(libs/flac-1.3.3 EXCLUDE_FROM_ALL)
add_subdirectory(libs/monkey-audio EXCLUDE_FROM_ALL)
add_subdirectory(libs/libopus EXCLUDE_FROM_ALL)
add_subdirectory(libs/libopusfile EXCLUDE_FROM_ALL)
set(CMAKE_CXX_FLAGS "-std=c++11")
target_link_libraries(portamp
libogg
libvorbis
libmodplug
libflac
id3v2
monkeyaudio
libopus
libopusfile
dl
pthread
)
include_directories(/usr/local/include /opt/local/include)
find_package(OpenAL REQUIRED)
target_link_libraries(portamp "${OPENAL_LIBRARY}")
else()
add_subdirectory(libs/monkey-audio EXCLUDE_FROM_ALL)
set(CMAKE_CXX_FLAGS "-std=c++11")
target_link_libraries(portamp
ogg
vorbis
vorbisfile
modplug
FLAC
monkeyaudio
opus
opusfile
pthread
dl
openal
)
include_directories(/usr/local/include)
endif()