2013-11-11 17:29:48 +08:00
|
|
|
# architecture
|
|
|
|
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|
|
|
set(ARCH_DIR "64-bit")
|
|
|
|
else()
|
|
|
|
set(ARCH_DIR "32-bit")
|
|
|
|
endif()
|
|
|
|
|
2013-11-30 14:09:12 +08:00
|
|
|
if(WIN32)
|
|
|
|
set(AUDIO_SRC
|
|
|
|
win32/SimpleAudioEngine.cpp
|
|
|
|
win32/MciPlayer.cpp
|
2014-05-04 14:01:13 +08:00
|
|
|
win32/MciPlayer.h
|
2013-11-30 14:09:12 +08:00
|
|
|
)
|
2013-12-02 14:37:32 +08:00
|
|
|
elseif(APPLE)
|
2013-11-30 14:09:12 +08:00
|
|
|
|
|
|
|
else()
|
|
|
|
set(AUDIO_SRC
|
|
|
|
linux/SimpleAudioEngineFMOD.cpp
|
|
|
|
linux/FmodAudioPlayer.cpp
|
2014-05-04 14:01:13 +08:00
|
|
|
linux/FmodAudioPlayer.h
|
|
|
|
linux/AudioPlayer.h
|
2013-11-30 14:09:12 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
../../external/linux-specific/fmod/include/${ARCH_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
2013-11-11 17:29:48 +08:00
|
|
|
|
2013-11-02 18:07:34 +08:00
|
|
|
add_library(audio STATIC
|
|
|
|
${AUDIO_SRC}
|
2014-05-04 14:01:13 +08:00
|
|
|
include/Export.h
|
|
|
|
include/SimpleAudioEngine.h
|
2013-11-02 18:07:34 +08:00
|
|
|
)
|
|
|
|
|
2013-11-30 14:09:12 +08:00
|
|
|
if((NOT APPLE) AND (NOT WIN32))
|
|
|
|
|
2013-11-06 14:54:35 +08:00
|
|
|
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|
|
|
set(FMOD_LIB "fmodex64")
|
|
|
|
else()
|
|
|
|
set(FMOD_LIB "fmodex")
|
|
|
|
endif()
|
|
|
|
|
2013-11-02 18:07:34 +08:00
|
|
|
target_link_libraries(audio
|
2013-11-06 14:54:35 +08:00
|
|
|
${FMOD_LIB}
|
2013-11-04 14:49:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(audio
|
|
|
|
PROPERTIES
|
2014-01-07 15:44:36 +08:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
2013-11-04 14:49:42 +08:00
|
|
|
)
|
2014-01-08 16:58:36 +08:00
|
|
|
|
|
|
|
elseif(WIN32)
|
|
|
|
|
|
|
|
target_link_libraries(audio
|
|
|
|
Winmm
|
|
|
|
)
|
|
|
|
|
2013-11-30 14:09:12 +08:00
|
|
|
endif()
|