CMakeLists.txt
author Sylvain Becker
Tue, 13 Aug 2019 15:51:57 +0200
changeset 933 8b275092fdbb
child 934 c251a3a6a2df
permissions -rw-r--r--
Android: add compilation with cmake (see bug 3918)
sylvain@933
     1
cmake_minimum_required(VERSION 3.0)
sylvain@933
     2
project(SDL_mixer C)
sylvain@933
     3
sylvain@933
     4
sylvain@933
     5
if (ANDROID)
sylvain@933
     6
sylvain@933
     7
    # FIXME: there are missing CMakeLists.txt 
sylvain@933
     8
    option(SUPPORT_FLAC "Support loading FLAC music with libFLAC" OFF)
sylvain@933
     9
    option(SUPPORT_OGG "Support loading OGG Vorbis music via Tremor" OFF)
sylvain@933
    10
    option(SUPPORT_MP3_MPG123 "Support loading MP3 music via MPG123" OFF)
sylvain@933
    11
    option(SUPPORT_MOD_MODPLUG "Support loading MOD music via modplug" OFF)
sylvain@933
    12
    option(SUPPORT_MID_TIMIDITY "Support TiMidity" OFF)
sylvain@933
    13
sylvain@933
    14
    add_library(SDL_mixer SHARED)
sylvain@933
    15
sylvain@933
    16
    target_sources(SDL_mixer PRIVATE
sylvain@933
    17
            effect_position.c effects_internal.c
sylvain@933
    18
            effect_stereoreverse.c load_aiff.c load_voc.c mixer.c music.c
sylvain@933
    19
            music_cmd.c music_flac.c music_fluidsynth.c music_mad.c
sylvain@933
    20
            music_mikmod.c music_modplug.c music_mpg123.c music_nativemidi.c
sylvain@933
    21
            music_ogg.c music_opus.c music_timidity.c music_wav.c)
sylvain@933
    22
sylvain@933
    23
    if (SUPPORT_FLAC)
sylvain@933
    24
        add_definitions(-DMUSIC_FLAC)
sylvain@933
    25
        add_subdirectory(external/flac-1.3.2)
sylvain@933
    26
        target_link_libraries(SDL_mixer PRIVATE libFLAC)
sylvain@933
    27
    endif()
sylvain@933
    28
sylvain@933
    29
    if (SUPPORT_OGG)
sylvain@933
    30
        add_definitions(-DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>")
sylvain@933
    31
        add_subdirectory(external/libogg-1.3.2)
sylvain@933
    32
        add_subdirectory(external/libvorbisidec-1.2.1)
sylvain@933
    33
        target_link_libraries(SDL_mixer PRIVATE ogg vorbisidec)
sylvain@933
    34
    endif()
sylvain@933
    35
sylvain@933
    36
    if (SUPPORT_MP3_MPG123)
sylvain@933
    37
        add_definitions(-DMUSIC_MP3_MPG123)
sylvain@933
    38
        add_subdirectory(external/mpg123-1.25.6)
sylvain@933
    39
        target_link_libraries(SDL_mixer PRIVATE mpg123)
sylvain@933
    40
    endif()
sylvain@933
    41
sylvain@933
    42
    if (SUPPORT_MOD_MODPLUG)
sylvain@933
    43
        add_definitions(-DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>")
sylvain@933
    44
        add_subdirectory(external/libmodplug-0.8.9.0)
sylvain@933
    45
        target_link_libraries(SDL_mixer PRIVATE modplug)
sylvain@933
    46
    endif()
sylvain@933
    47
sylvain@933
    48
    if (SUPPORT_MID_TIMIDITY)
sylvain@933
    49
        add_definitions(-DMUSIC_MID_TIMIDITY)
sylvain@933
    50
        add_subdirectory(timidity)
sylvain@933
    51
        target_link_libraries(SDL_mixer PRIVATE timidity)
sylvain@933
    52
    endif()
sylvain@933
    53
sylvain@933
    54
    target_link_libraries(SDL_mixer PRIVATE SDL2)
sylvain@933
    55
else()
sylvain@933
    56
sylvain@933
    57
endif()