CMakeLists.txt
changeset 933 8b275092fdbb
child 934 c251a3a6a2df
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/CMakeLists.txt	Tue Aug 13 15:51:57 2019 +0200
     1.3 @@ -0,0 +1,57 @@
     1.4 +cmake_minimum_required(VERSION 3.0)
     1.5 +project(SDL_mixer C)
     1.6 +
     1.7 +
     1.8 +if (ANDROID)
     1.9 +
    1.10 +    # FIXME: there are missing CMakeLists.txt 
    1.11 +    option(SUPPORT_FLAC "Support loading FLAC music with libFLAC" OFF)
    1.12 +    option(SUPPORT_OGG "Support loading OGG Vorbis music via Tremor" OFF)
    1.13 +    option(SUPPORT_MP3_MPG123 "Support loading MP3 music via MPG123" OFF)
    1.14 +    option(SUPPORT_MOD_MODPLUG "Support loading MOD music via modplug" OFF)
    1.15 +    option(SUPPORT_MID_TIMIDITY "Support TiMidity" OFF)
    1.16 +
    1.17 +    add_library(SDL_mixer SHARED)
    1.18 +
    1.19 +    target_sources(SDL_mixer PRIVATE
    1.20 +            effect_position.c effects_internal.c
    1.21 +            effect_stereoreverse.c load_aiff.c load_voc.c mixer.c music.c
    1.22 +            music_cmd.c music_flac.c music_fluidsynth.c music_mad.c
    1.23 +            music_mikmod.c music_modplug.c music_mpg123.c music_nativemidi.c
    1.24 +            music_ogg.c music_opus.c music_timidity.c music_wav.c)
    1.25 +
    1.26 +    if (SUPPORT_FLAC)
    1.27 +        add_definitions(-DMUSIC_FLAC)
    1.28 +        add_subdirectory(external/flac-1.3.2)
    1.29 +        target_link_libraries(SDL_mixer PRIVATE libFLAC)
    1.30 +    endif()
    1.31 +
    1.32 +    if (SUPPORT_OGG)
    1.33 +        add_definitions(-DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>")
    1.34 +        add_subdirectory(external/libogg-1.3.2)
    1.35 +        add_subdirectory(external/libvorbisidec-1.2.1)
    1.36 +        target_link_libraries(SDL_mixer PRIVATE ogg vorbisidec)
    1.37 +    endif()
    1.38 +
    1.39 +    if (SUPPORT_MP3_MPG123)
    1.40 +        add_definitions(-DMUSIC_MP3_MPG123)
    1.41 +        add_subdirectory(external/mpg123-1.25.6)
    1.42 +        target_link_libraries(SDL_mixer PRIVATE mpg123)
    1.43 +    endif()
    1.44 +
    1.45 +    if (SUPPORT_MOD_MODPLUG)
    1.46 +        add_definitions(-DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>")
    1.47 +        add_subdirectory(external/libmodplug-0.8.9.0)
    1.48 +        target_link_libraries(SDL_mixer PRIVATE modplug)
    1.49 +    endif()
    1.50 +
    1.51 +    if (SUPPORT_MID_TIMIDITY)
    1.52 +        add_definitions(-DMUSIC_MID_TIMIDITY)
    1.53 +        add_subdirectory(timidity)
    1.54 +        target_link_libraries(SDL_mixer PRIVATE timidity)
    1.55 +    endif()
    1.56 +
    1.57 +    target_link_libraries(SDL_mixer PRIVATE SDL2)
    1.58 +else()
    1.59 +
    1.60 +endif()