forked from oxygine/oxygine-sound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
130 lines (95 loc) · 3.07 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
cmake_minimum_required (VERSION 2.6)
project (OXYGINESOUND)
set(OXYGINESOUND_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/tremor/Tremor
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libogg/include
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
message(status ${OXYGINESOUND_INCLUDE_DIRS})
set(OXYGINESOUND_DEFINITIONS
-DOXYGINE_SOUND=1)
set(SRC
src/sound/ResSound.cpp
src/sound/ResSound.h
src/sound/Sound.h
src/sound/SoundInstance.cpp
src/sound/SoundInstance.h
src/sound/SoundPlayer.cpp
src/sound/SoundPlayer.h
src/sound/SoundSystem.cpp
src/sound/SoundSystem.h
src/sound/null/SoundSystemNull.cpp
src/sound/null/SoundSystemNull.h
src/sound/null/SoundNull.cpp
src/sound/null/SoundNull.h
src/sound/null/SoundHandleNull.cpp
src/sound/null/SoundHandleNull.h
)
if(EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SRC ${SRC}
src/sound/emscripten/SoundSystemEmscripten.h
src/sound/emscripten/SoundSystemEmscripten.cpp
src/sound/emscripten/SoundHandleEmscripten.h
src/sound/emscripten/SoundHandleEmscripten.cpp
src/sound/emscripten/SoundEmscripten.h
src/sound/emscripten/SoundEmscripten.cpp
)
else(EMSCRIPTEN)
add_subdirectory(dependencies/tremor tremor)
set (SRC ${SRC}
src/sound/OggStream.cpp
src/sound/OggStream.h
src/sound/MemoryStream.cpp
src/sound/MemoryStream.h
src/sound/WavStream.cpp
src/sound/WavStream.h
src/sound/oal/SoundHandleOAL.cpp
src/sound/oal/SoundHandleOAL.h
src/sound/oal/SoundOAL.cpp
src/sound/oal/SoundOAL.h
src/sound/oal/SoundSystemOAL.cpp
src/sound/oal/SoundSystemOAL.h
src/sound/oal/StreamingSoundHandleOAL.cpp
src/sound/oal/StreamingSoundHandleOAL.h
src/sound/oal/StaticSoundHandleOAL.cpp
src/sound/oal/StaticSoundHandleOAL.h
src/sound/oal/StaticStreamOAL.cpp
src/sound/oal/StaticStreamOAL.h
)
endif(EMSCRIPTEN)
add_library(oxygine-sound STATIC ${SRC})
if(EMSCRIPTEN)
set(OXYGINESOUND_LIBS
oxygine-sound)
set(linkFlags "-Wno-warn-absolute-paths")
set_target_properties(oxygine-sound PROPERTIES LINK_FLAGS "${linkFlags}")
else(EMSCRIPTEN)
set(OXYGINESOUND_INCLUDE_DIRS ${OXYGINESOUND_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openal/include)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(OXYGINESOUND_LIBS oxygine-sound -lopenal tremor -logg)
else()
set(LIBOGG libogg_static)
if (MSVC)
if(NOT (MSVC_VERSION LESS 1900))
set(LIBOGG ${LIBOGG}_vs2013)
endif()
endif()
set(OXYGINESOUND_LIBS
${CMAKE_CURRENT_SOURCE_DIR}/libs/win32/OpenAL32.lib
${CMAKE_CURRENT_SOURCE_DIR}/libs/win32/${LIBOGG}.lib
tremor
oxygine-sound)
endif()
endif(EMSCRIPTEN)
include_directories(${OXYGINESOUND_INCLUDE_DIRS})
target_link_libraries(oxygine-sound -lopenal)
target_link_libraries(oxygine-sound -logg)
#target_link_libraries(oxyginemagicparticles)
set(OXYGINESOUND_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/src)
set(OXYGINESOUND_INCLUDE_DIRS ${OXYGINESOUND_INCLUDE_DIRS} PARENT_SCOPE)
set(OXYGINESOUND_LIBS ${OXYGINESOUND_LIBS} PARENT_SCOPE)
set(OXYGINESOUND_DEFINITIONS ${OXYGINESOUND_DEFINITIONS} PARENT_SCOPE)