2019-09-28 16:32:25 +00:00
|
|
|
cmake_minimum_required( VERSION 2.8.7 )
|
|
|
|
|
|
|
|
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
|
|
|
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ZD_FASTMATH_FLAG}")
|
|
|
|
|
|
|
|
include( CheckFunctionExists )
|
|
|
|
|
|
|
|
CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
|
|
|
|
if( NOT STRICMP_EXISTS )
|
|
|
|
add_definitions( -Dstricmp=strcasecmp )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
|
|
|
|
if( NOT STRNICMP_EXISTS )
|
|
|
|
add_definitions( -Dstrnicmp=strncasecmp )
|
|
|
|
endif()
|
|
|
|
|
2019-09-29 10:48:12 +00:00
|
|
|
if( DYN_SNDFILE)
|
|
|
|
add_definitions( -DHAVE_SNDFILE -DDYN_SNDFILE )
|
|
|
|
elseif( SNDFILE_FOUND )
|
|
|
|
add_definitions( -DHAVE_SNDFILE )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( DYN_MPG123)
|
|
|
|
add_definitions( -DHAVE_MPG123 -DDYN_MPG123 )
|
|
|
|
elseif( MPG123_FOUND )
|
|
|
|
add_definitions( -DHAVE_MPG123 )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( DYN_FLUIDSYNTH )
|
|
|
|
add_definitions( -DHAVE_FLUIDSYNTH -DDYN_FLUIDSYNTH )
|
|
|
|
elseif( FLUIDSYNTH_FOUND )
|
|
|
|
add_definitions( -DHAVE_FLUIDSYNTH )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2019-09-30 00:35:47 +00:00
|
|
|
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../libraries/dumb/include" "${ADL_INCLUDE_DIR}" "${OPN_INCLUDE_DIR}" "${TIMIDITYPP_INCLUDE_DIR}" "${TIMIDITY_INCLUDE_DIR}" "${WILDMIDI_INCLUDE_DIR}" "${OPLSYNTH_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" )
|
2019-09-28 16:32:25 +00:00
|
|
|
|
|
|
|
if (WIN32)
|
2019-09-30 00:22:53 +00:00
|
|
|
set( PLAT_SOURCES
|
|
|
|
mididevices/music_win_mididevice.cpp
|
|
|
|
musicformats/win32/i_cd.cpp
|
|
|
|
musicformats/win32/helperthread.cpp
|
|
|
|
)
|
2019-09-28 16:32:25 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
file( GLOB HEADER_FILES
|
|
|
|
zmusic/*.h
|
2019-09-29 11:06:40 +00:00
|
|
|
mididevices/*.h
|
|
|
|
midisources/*.h
|
2019-09-30 00:10:00 +00:00
|
|
|
musicformats/*.h
|
2019-09-29 11:06:40 +00:00
|
|
|
decoder/*.h
|
2019-09-29 11:33:09 +00:00
|
|
|
streamsources/*.h
|
2019-09-29 11:06:40 +00:00
|
|
|
thirdparty/*.h
|
2019-09-28 16:32:25 +00:00
|
|
|
)
|
|
|
|
add_library( zmusic STATIC
|
2019-09-29 11:06:40 +00:00
|
|
|
${HEADER_FILES}
|
2019-09-28 16:32:25 +00:00
|
|
|
i_module.cpp
|
|
|
|
mididevices/music_base_mididevice.cpp
|
|
|
|
mididevices/music_adlmidi_mididevice.cpp
|
|
|
|
mididevices/music_opl_mididevice.cpp
|
|
|
|
mididevices/music_opnmidi_mididevice.cpp
|
|
|
|
mididevices/music_timiditypp_mididevice.cpp
|
|
|
|
mididevices/music_fluidsynth_mididevice.cpp
|
|
|
|
mididevices/music_softsynth_mididevice.cpp
|
|
|
|
mididevices/music_timidity_mididevice.cpp
|
|
|
|
mididevices/music_wildmidi_mididevice.cpp
|
|
|
|
mididevices/music_wavewriter_mididevice.cpp
|
|
|
|
midisources/midisource.cpp
|
|
|
|
midisources/midisource_mus.cpp
|
|
|
|
midisources/midisource_smf.cpp
|
|
|
|
midisources/midisource_hmi.cpp
|
|
|
|
midisources/midisource_xmi.cpp
|
2019-09-29 11:33:09 +00:00
|
|
|
streamsources/music_dumb.cpp
|
|
|
|
streamsources/music_gme.cpp
|
|
|
|
streamsources/music_libsndfile.cpp
|
|
|
|
streamsources/music_opl.cpp
|
|
|
|
streamsources/music_xa.cpp
|
2019-09-30 00:10:00 +00:00
|
|
|
musicformats/music_stream.cpp
|
|
|
|
musicformats/music_midi.cpp
|
2019-09-30 00:22:53 +00:00
|
|
|
musicformats/music_cd.cpp
|
2019-09-29 10:48:12 +00:00
|
|
|
decoder/sounddecoder.cpp
|
|
|
|
decoder/sndfile_decoder.cpp
|
|
|
|
decoder/mpg123_decoder.cpp
|
2019-09-29 18:01:57 +00:00
|
|
|
zmusic/configuration.cpp
|
2019-09-30 00:35:47 +00:00
|
|
|
zmusic/zmusic.cpp
|
2019-09-30 00:22:53 +00:00
|
|
|
${PLAT_SOURCES}
|
2019-09-28 16:32:25 +00:00
|
|
|
)
|
|
|
|
target_link_libraries( zmusic )
|
|
|
|
|
|
|
|
|
|
|
|
source_group("MIDI Devices" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/mididevices/.+")
|
|
|
|
source_group("MIDI Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/midisources/.+")
|
2019-09-30 00:10:00 +00:00
|
|
|
source_group("Music Formats" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/musicformats/.+")
|
2019-09-30 00:22:53 +00:00
|
|
|
source_group("Music Formats\\Win32" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/musicformats/win32/.+")
|
2019-09-29 18:01:57 +00:00
|
|
|
source_group("Public Interface" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/zmusic/.+")
|
2019-09-29 11:06:40 +00:00
|
|
|
source_group("Sound Decoding" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/decoder/.+")
|
2019-09-29 11:33:09 +00:00
|
|
|
source_group("Stream Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/streamsources/.+")
|
2019-09-29 11:06:40 +00:00
|
|
|
source_group("Third Party" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/.+")
|