deps: update sdl2_mixer to 2.8.0

This commit is contained in:
alexey.lysiuk 2024-01-24 13:34:08 +02:00
parent 9d874f61b1
commit d0dc8da084
19 changed files with 447 additions and 159 deletions

View file

@ -1,6 +1,6 @@
/* /*
SDL_mixer: An audio mixer library based on the SDL library SDL_mixer: An audio mixer library based on the SDL library
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org> Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -45,8 +45,8 @@ extern "C" {
* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/ */
#define SDL_MIXER_MAJOR_VERSION 2 #define SDL_MIXER_MAJOR_VERSION 2
#define SDL_MIXER_MINOR_VERSION 6 #define SDL_MIXER_MINOR_VERSION 8
#define SDL_MIXER_PATCHLEVEL 3 #define SDL_MIXER_PATCHLEVEL 0
/** /**
* This macro can be used to fill a version structure with the compile-time * This macro can be used to fill a version structure with the compile-time
@ -112,15 +112,20 @@ typedef enum
MIX_INIT_MP3 = 0x00000008, MIX_INIT_MP3 = 0x00000008,
MIX_INIT_OGG = 0x00000010, MIX_INIT_OGG = 0x00000010,
MIX_INIT_MID = 0x00000020, MIX_INIT_MID = 0x00000020,
MIX_INIT_OPUS = 0x00000040 MIX_INIT_OPUS = 0x00000040,
MIX_INIT_WAVPACK= 0x00000080
} MIX_InitFlags; } MIX_InitFlags;
/** /**
* Initialize SDL_mixer. * Initialize SDL_mixer.
* *
* This function loads dynamic libraries that SDL_mixer needs, and prepares * This function loads dynamic libraries that SDL_mixer needs, and prepares
* them for use. This must be the first function you call in SDL_mixer, and if * them for use.
* it fails you should not continue with the library. *
* Note that, unlike other SDL libraries, this call is optional! If you load a
* music file, SDL_mixer will handle initialization on the fly. This function
* will let you know, up front, whether a specific format will be available
* for use.
* *
* Flags should be one or more flags from MIX_InitFlags OR'd together. It * Flags should be one or more flags from MIX_InitFlags OR'd together. It
* returns the flags successfully initialized, or 0 on failure. * returns the flags successfully initialized, or 0 on failure.
@ -133,6 +138,7 @@ typedef enum
* - `MIX_INIT_OGG` * - `MIX_INIT_OGG`
* - `MIX_INIT_MID` * - `MIX_INIT_MID`
* - `MIX_INIT_OPUS` * - `MIX_INIT_OPUS`
* - `MIX_INIT_WAVPACK`
* *
* More flags may be added in a future SDL_mixer release. * More flags may be added in a future SDL_mixer release.
* *
@ -214,11 +220,7 @@ extern DECLSPEC void SDLCALL Mix_Quit(void);
/* Good default values for a PC soundcard */ /* Good default values for a PC soundcard */
#define MIX_DEFAULT_FREQUENCY 44100 #define MIX_DEFAULT_FREQUENCY 44100
#if SDL_BYTEORDER == SDL_LIL_ENDIAN #define MIX_DEFAULT_FORMAT AUDIO_S16SYS
#define MIX_DEFAULT_FORMAT AUDIO_S16LSB
#else
#define MIX_DEFAULT_FORMAT AUDIO_S16MSB
#endif
#define MIX_DEFAULT_CHANNELS 2 #define MIX_DEFAULT_CHANNELS 2
#define MIX_MAX_VOLUME SDL_MIX_MAXVOLUME /* Volume of a chunk */ #define MIX_MAX_VOLUME SDL_MIX_MAXVOLUME /* Volume of a chunk */
@ -255,7 +257,9 @@ typedef enum {
MUS_MP3_MAD_UNUSED, MUS_MP3_MAD_UNUSED,
MUS_FLAC, MUS_FLAC,
MUS_MODPLUG_UNUSED, MUS_MODPLUG_UNUSED,
MUS_OPUS MUS_OPUS,
MUS_WAVPACK,
MUS_GME
} Mix_MusicType; } Mix_MusicType;
/** /**
@ -290,7 +294,7 @@ typedef struct _Mix_Music Mix_Music;
* it to the correct format on demand. * it to the correct format on demand.
* *
* That being said, if you have control of your audio data and you know its * That being said, if you have control of your audio data and you know its
* format ahead of time, you can save CPU time by opening the audio device in * format ahead of time, you may save CPU time by opening the audio device in
* that exact format so SDL_mixer does not have to spend time converting * that exact format so SDL_mixer does not have to spend time converting
* anything behind the scenes, and can just pass the data straight through to * anything behind the scenes, and can just pass the data straight through to
* the hardware. On some platforms, where the hardware only supports specific * the hardware. On some platforms, where the hardware only supports specific
@ -336,7 +340,7 @@ typedef struct _Mix_Music Mix_Music;
* The app can use Mix_QuerySpec() to determine the final device settings. * The app can use Mix_QuerySpec() to determine the final device settings.
* *
* When done with an audio device, probably at the end of the program, the app * When done with an audio device, probably at the end of the program, the app
* should dispose of the device with Mix_CloseDevice(). * should dispose of the device with Mix_CloseAudio().
* *
* \param frequency the frequency to playback audio at (in Hz). * \param frequency the frequency to playback audio at (in Hz).
* \param format audio format, one of SDL's AUDIO_* values. * \param format audio format, one of SDL's AUDIO_* values.
@ -348,7 +352,7 @@ typedef struct _Mix_Music Mix_Music;
* \since This function is available since SDL_mixer 2.0.0. * \since This function is available since SDL_mixer 2.0.0.
* *
* \sa Mix_OpenAudioDevice * \sa Mix_OpenAudioDevice
* \sa Mix_CloseDevice * \sa Mix_CloseAudio
*/ */
extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize); extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize);
@ -457,6 +461,15 @@ extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int chan
*/ */
extern DECLSPEC int SDLCALL Mix_OpenAudioDevice(int frequency, Uint16 format, int channels, int chunksize, const char* device, int allowed_changes); extern DECLSPEC int SDLCALL Mix_OpenAudioDevice(int frequency, Uint16 format, int channels, int chunksize, const char* device, int allowed_changes);
/**
* Suspend or resume the whole audio output.
*
* \param pause_on 1 to pause audio output, or 0 to resume.
*
* \since This function is available since SDL_mixer 2.8.0.
*/
extern DECLSPEC void SDLCALL Mix_PauseAudio(int pause_on);
/** /**
* Find out what the actual audio device parameters are. * Find out what the actual audio device parameters are.
* *
@ -709,6 +722,7 @@ extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *src, int freesrc);
* - `MUS_MP3` (MP3 files) * - `MUS_MP3` (MP3 files)
* - `MUS_FLAC` (FLAC files) * - `MUS_FLAC` (FLAC files)
* - `MUS_OPUS` (Opus files) * - `MUS_OPUS` (Opus files)
* - `MUS_WAVPACK` (WavPack files)
* *
* If `freesrc` is non-zero, the RWops will be closed before returning, * If `freesrc` is non-zero, the RWops will be closed before returning,
* whether this function succeeds or not. SDL_mixer reads everything it needs * whether this function succeeds or not. SDL_mixer reads everything it needs
@ -911,7 +925,7 @@ extern DECLSPEC SDL_bool SDLCALL Mix_HasChunkDecoder(const char *name);
* These return values are static, read-only data; do not modify or free it. * These return values are static, read-only data; do not modify or free it.
* The pointers remain valid until you call Mix_CloseAudio(). * The pointers remain valid until you call Mix_CloseAudio().
* *
* \returns number of chunk decoders available. * \returns number of music decoders available.
* *
* \since This function is available since SDL_mixer 2.0.0. * \since This function is available since SDL_mixer 2.0.0.
* *
@ -1361,7 +1375,7 @@ extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix
* zero if there's an error, not on success. We apologize for the API design * zero if there's an error, not on success. We apologize for the API design
* inconsistency here. * inconsistency here.
* *
* \param chan the channel to unregister an effect on, or MIX_CHANNEL_POST. * \param channel the channel to unregister an effect on, or MIX_CHANNEL_POST.
* \param f effect the callback stop calling in future mixing iterations. * \param f effect the callback stop calling in future mixing iterations.
* \returns zero if error (no such channel or effect), nonzero if removed. * \returns zero if error (no such channel or effect), nonzero if removed.
* Error messages can be retrieved from Mix_GetError(). * Error messages can be retrieved from Mix_GetError().
@ -1387,7 +1401,8 @@ extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f
* zero if there's an error, not on success. We apologize for the API design * zero if there's an error, not on success. We apologize for the API design
* inconsistency here. * inconsistency here.
* *
* \param chan the channel to unregister all effects on, or MIX_CHANNEL_POST. * \param channel the channel to unregister all effects on, or
* MIX_CHANNEL_POST.
* \returns zero if error (no such channel), nonzero if all effects removed. * \returns zero if error (no such channel), nonzero if all effects removed.
* Error messages can be retrieved from Mix_GetError(). * Error messages can be retrieved from Mix_GetError().
* *
@ -1459,7 +1474,7 @@ extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right)
* Set the position of a channel. * Set the position of a channel.
* *
* `angle` is an integer from 0 to 360, that specifies the location of the * `angle` is an integer from 0 to 360, that specifies the location of the
* sound in relation to the listener. `angle` will be reduced as neccesary * sound in relation to the listener. `angle` will be reduced as necessary
* (540 becomes 180 degrees, -100 becomes 260). Angle 0 is due north, and * (540 becomes 180 degrees, -100 becomes 260). Angle 0 is due north, and
* rotates clockwise as the value increases. For efficiency, the precision of * rotates clockwise as the value increases. For efficiency, the precision of
* this effect may be limited (angles 1 through 7 might all produce the same * this effect may be limited (angles 1 through 7 might all produce the same
@ -1745,8 +1760,8 @@ extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag);
* *
* \param channel the channel on which to play the new chunk. * \param channel the channel on which to play the new chunk.
* \param chunk the new chunk to play. * \param chunk the new chunk to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \returns which channel was used to play the sound, or -1 if sound could not * \returns which channel was used to play the sound, or -1 if sound could not
* be played. * be played.
* *
@ -1777,8 +1792,8 @@ extern DECLSPEC int SDLCALL Mix_PlayChannel(int channel, Mix_Chunk *chunk, int l
* *
* \param channel the channel on which to play the new chunk. * \param channel the channel on which to play the new chunk.
* \param chunk the new chunk to play. * \param chunk the new chunk to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \param ticks the maximum number of milliseconds of this chunk to mix for * \param ticks the maximum number of milliseconds of this chunk to mix for
* playback. * playback.
* \returns which channel was used to play the sound, or -1 if sound could not * \returns which channel was used to play the sound, or -1 if sound could not
@ -1829,8 +1844,8 @@ extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops);
* Mix_VolumeMusic() on fading music). * Mix_VolumeMusic() on fading music).
* *
* \param music the new music object to play. * \param music the new music object to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \param ms the number of milliseconds to spend fading in. * \param ms the number of milliseconds to spend fading in.
* \returns zero on success, -1 on error. * \returns zero on success, -1 on error.
* *
@ -1866,8 +1881,8 @@ extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms)
* To convert from milliseconds, divide by 1000.0. * To convert from milliseconds, divide by 1000.0.
* *
* \param music the new music object to play. * \param music the new music object to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \param ms the number of milliseconds to spend fading in. * \param ms the number of milliseconds to spend fading in.
* \param position the start position within the music, in seconds, where * \param position the start position within the music, in seconds, where
* playback should start. * playback should start.
@ -1907,8 +1922,8 @@ extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int
* \param channel the channel on which to play the new chunk, or -1 to find * \param channel the channel on which to play the new chunk, or -1 to find
* any available. * any available.
* \param chunk the new chunk to play. * \param chunk the new chunk to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \param ms the number of milliseconds to spend fading in. * \param ms the number of milliseconds to spend fading in.
* \returns which channel was used to play the sound, or -1 if sound could not * \returns which channel was used to play the sound, or -1 if sound could not
* be played. * be played.
@ -1950,8 +1965,8 @@ extern DECLSPEC int SDLCALL Mix_FadeInChannel(int channel, Mix_Chunk *chunk, int
* \param channel the channel on which to play the new chunk, or -1 to find * \param channel the channel on which to play the new chunk, or -1 to find
* any available. * any available.
* \param chunk the new chunk to play. * \param chunk the new chunk to play.
* \param loop the number of times the chunk should loop, -1 to loop (not * \param loops the number of times the chunk should loop, -1 to loop (not
* actually) infinitely. * actually) infinitely.
* \param ms the number of milliseconds to spend fading in. * \param ms the number of milliseconds to spend fading in.
* \param ticks the maximum number of milliseconds of this chunk to mix for * \param ticks the maximum number of milliseconds of this chunk to mix for
* playback. * playback.
@ -1994,7 +2009,7 @@ extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);
* Set the volume for a specific chunk. * Set the volume for a specific chunk.
* *
* In addition to channels having a volume setting, individual chunks also * In addition to channels having a volume setting, individual chunks also
* maintain a seperate volume. Both values are considered when mixing, so both * maintain a separate volume. Both values are considered when mixing, so both
* affect the final attenuation of the sound. This lets an app adjust the * affect the final attenuation of the sound. This lets an app adjust the
* volume for all instances of a sound in addition to specific instances of * volume for all instances of a sound in addition to specific instances of
* that sound. * that sound.
@ -2009,8 +2024,7 @@ extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume);
* *
* The default volume for a chunk is MIX_MAX_VOLUME (no attenuation). * The default volume for a chunk is MIX_MAX_VOLUME (no attenuation).
* *
* \param channel the channel on set/query the volume on, or -1 for all * \param chunk the chunk whose volume to adjust.
* channels.
* \param volume the new volume, between 0 and MIX_MAX_VOLUME, or -1 to query. * \param volume the new volume, between 0 and MIX_MAX_VOLUME, or -1 to query.
* \returns the previous volume. If the specified volume is -1, this returns * \returns the previous volume. If the specified volume is -1, this returns
* the current volume. If `chunk` is NULL, this returns -1. * the current volume. If `chunk` is NULL, this returns -1.
@ -2104,8 +2118,8 @@ extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel);
* This will stop further playback on all channels with a specific tag, until * This will stop further playback on all channels with a specific tag, until
* a new chunk is started there. * a new chunk is started there.
* *
* A tag is an arbitary number that can be assigned to several mixer channels, * A tag is an arbitrary number that can be assigned to several mixer
* to form groups of channels. * channels, to form groups of channels.
* *
* The default tag for a channel is -1. * The default tag for a channel is -1.
* *
@ -2183,7 +2197,7 @@ extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks);
* *
* \param which the channel to fade out. * \param which the channel to fade out.
* \param ms number of milliseconds to fade before halting the channel. * \param ms number of milliseconds to fade before halting the channel.
* \returns 0 on success, or -1 on error. * \returns the number of channels scheduled to fade.
* *
* \since This function is available since SDL_mixer 2.0.0. * \since This function is available since SDL_mixer 2.0.0.
*/ */
@ -2197,8 +2211,8 @@ extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms);
* current volumes to silence over `ms` milliseconds. After that time, those * current volumes to silence over `ms` milliseconds. After that time, those
* channels are halted. * channels are halted.
* *
* A tag is an arbitary number that can be assigned to several mixer channels, * A tag is an arbitrary number that can be assigned to several mixer
* to form groups of channels. * channels, to form groups of channels.
* *
* The default tag for a channel is -1. * The default tag for a channel is -1.
* *
@ -2239,7 +2253,6 @@ extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms);
* requested; it just schedules the music to fade and notes the time for the * requested; it just schedules the music to fade and notes the time for the
* mixer to manage later, and returns immediately. * mixer to manage later, and returns immediately.
* *
* \param which the channel to fade out.
* \param ms number of milliseconds to fade before halting the channel. * \param ms number of milliseconds to fade before halting the channel.
* \returns non-zero if music was scheduled to fade, zero otherwise. If no * \returns non-zero if music was scheduled to fade, zero otherwise. If no
* music is currently playing, this returns zero. * music is currently playing, this returns zero.
@ -2408,6 +2421,32 @@ extern DECLSPEC int SDLCALL Mix_PausedMusic(void);
*/ */
extern DECLSPEC int SDLCALL Mix_ModMusicJumpToOrder(int order); extern DECLSPEC int SDLCALL Mix_ModMusicJumpToOrder(int order);
/**
* Start a track in music object.
*
* This only applies to GME music formats.
*
* \param music the music object.
* \param track the track number to play. 0 is the first track.
* \returns 0 if successful, or -1 if failed or isn't implemented.
*
* \since This function is available since SDL_mixer 2.8.0.
*/
extern DECLSPEC int SDLCALL Mix_StartTrack(Mix_Music *music, int track);
/**
* Get number of tracks in music object.
*
* This only applies to GME music formats.
*
* \param music the music object.
* \returns number of tracks if successful, or -1 if failed or isn't
* implemented.
*
* \since This function is available since SDL_mixer 2.8.0.
*/
extern DECLSPEC int SDLCALL Mix_GetNumTracks(Mix_Music *music);
/** /**
* Set the current position in the music stream, in seconds. * Set the current position in the music stream, in seconds.
* *
@ -2777,8 +2816,7 @@ extern DECLSPEC void SDLCALL Mix_CloseAudio(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "close_code.h" #include "close_code.h"
#endif /* SDL_MIXER_H_ */ #endif /* SDL_MIXER_H_ */
/* vi: set ts=4 sw=4 expandtab: */

View file

@ -1,18 +1,29 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_FLAC QUIET flac)
find_library(FLAC_LIBRARY find_library(FLAC_LIBRARY
NAMES FLAC NAMES FLAC
HINTS ${PC_FLAC_LIBDIR}
) )
find_path(FLAC_INCLUDE_PATH find_path(FLAC_INCLUDE_PATH
NAMES FLAC/all.h NAMES FLAC/all.h
HINTS ${PC_FLAC_INCLUDEDIR}
) )
set(FLAC_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of FLAC") if(PC_FLAC_FOUND)
get_flags_from_pkg_config("${FLAC_LIBRARY}" "PC_FLAC" "_flac")
endif()
set(FLAC_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of FLAC") set(FLAC_COMPILE_OPTIONS "${_flac_compile_options}" CACHE STRING "Extra compile options of FLAC")
set(FLAC_LINK_FLAGS "" CACHE STRING "Extra link flags of FLAC") set(FLAC_LINK_LIBRARIES "${_flac_link_libraries}" CACHE STRING "Extra link libraries of FLAC")
set(FLAC_LINK_OPTIONS "${_flac_link_options}" CACHE STRING "Extra link flags of FLAC")
set(FLAC_LINK_DIRECTORIES "${_flac_link_directories}" CACHE PATH "Extra link directories of FLAC")
find_package_handle_standard_args(FLAC find_package_handle_standard_args(FLAC
REQUIRED_VARS FLAC_LIBRARY FLAC_INCLUDE_PATH REQUIRED_VARS FLAC_LIBRARY FLAC_INCLUDE_PATH
@ -26,7 +37,8 @@ if(FLAC_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${FLAC_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${FLAC_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${FLAC_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${FLAC_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${FLAC_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${FLAC_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${FLAC_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,32 +1,44 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_FLUIDSYNTH QUIET fluidsynth)
find_library(FluidSynth_LIBRARY find_library(FluidSynth_LIBRARY
NAMES fluidsynth NAMES fluidsynth libfluidsynth
HINTS ${PC_FLUIDSYNTH_LIBDIR}
) )
find_path(FluidSynth_INCLUDE_PATH find_path(FluidSynth_INCLUDE_PATH
NAMES fluidsynth.h NAMES fluidsynth.h
HINTS ${PC_FLUIDSYNTH_INCLUDEDIR}
) )
set(FluidSynth_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of FluidSynth") if(PC_FLUIDSYNTH_FOUND)
get_flags_from_pkg_config("${FluidSynth_LIBRARY}" "PC_FLUIDSYNTH" "_fluidsynth")
endif()
set(FluidSynth_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of FluidSynth") set(FluidSynth_COMPILE_OPTIONS "${_fluidsynth_compile_options}" CACHE STRING "Extra compile options of FluidSynth")
set(FluidSynth_LINK_FLAGS "" CACHE STRING "Extra link flags of FluidSynth") set(FluidSynth_LINK_LIBRARIES "${_fluidsynth_link_libraries}" CACHE STRING "Extra link libraries of FluidSynth")
set(FluidSynth_LINK_OPTIONS "${_fluidsynth_link_options}" CACHE STRING "Extra link flags of FluidSynth")
set(FluidSynth_LINK_DIRECTORIES "${_fluidsynth_link_directories}" CACHE PATH "Extra link directories of FluidSynth")
find_package_handle_standard_args(FluidSynth find_package_handle_standard_args(FluidSynth
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_PATH REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_PATH
) )
if(FluidSynth_FOUND) if(FluidSynth_FOUND)
if(NOT TARGET FluidSynth::FluidSynth) if(NOT TARGET FluidSynth::libfluidsynth)
add_library(FluidSynth::FluidSynth UNKNOWN IMPORTED) add_library(FluidSynth::libfluidsynth UNKNOWN IMPORTED)
set_target_properties(FluidSynth::FluidSynth PROPERTIES set_target_properties(FluidSynth::libfluidsynth PROPERTIES
IMPORTED_LOCATION "${FluidSynth_LIBRARY}" IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${FluidSynth_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${FluidSynth_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${FluidSynth_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${FluidSynth_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${FluidSynth_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${FluidSynth_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${FluidSynth_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,32 +1,44 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_library(MPG123_LIBRARY find_package(PkgConfig QUIET)
pkg_check_modules(PC_MPG123 QUIET libmpg123)
find_library(mpg123_LIBRARY
NAMES mpg123 NAMES mpg123
HINTS ${PC_MPG123_LIBDIR}
) )
find_path(MPG123_INCLUDE_PATH find_path(mpg123_INCLUDE_PATH
NAMES mpg123.h NAMES mpg123.h
HINTS ${PC_MPG123_INCLUDEDIR}
) )
set(MPG123_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of mpg123") if(PC_MPG123_FOUND)
get_flags_from_pkg_config("${mpg123_LIBRARY}" "PC_MPG123" "_mpg123")
endif()
set(MPG123_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of mpg123") set(mpg123_COMPILE_OPTIONS "${_mpg123_compile_options}" CACHE STRING "Extra compile options of mpg123")
set(MPG123_LINK_FLAGS "" CACHE STRING "Extra link flags of mpg123") set(mpg123_LINK_LIBRARIES "${_mpg123_link_libraries}" CACHE STRING "Extra link libraries of mpg123")
find_package_handle_standard_args(MPG123 set(mpg123_LINK_OPTIONS "${_mpg123_link_options}" CACHE STRING "Extra link flags of mpg123")
REQUIRED_VARS MPG123_LIBRARY MPG123_INCLUDE_PATH
set(mpg123_LINK_DIRECTORIES "${_mpg123_link_directories}" CACHE PATH "Extra link directories of mpg123")
find_package_handle_standard_args(mpg123
REQUIRED_VARS mpg123_LIBRARY mpg123_INCLUDE_PATH
) )
if (MPG123_FOUND) if(mpg123_FOUND)
if (NOT TARGET MPG123::mpg123) if(NOT TARGET MPG123::libmpg123)
add_library(MPG123::mpg123 UNKNOWN IMPORTED) add_library(MPG123::libmpg123 UNKNOWN IMPORTED)
set_target_properties(MPG123::mpg123 PROPERTIES set_target_properties(MPG123::libmpg123 PROPERTIES
IMPORTED_LOCATION "${MPG123_LIBRARY}" IMPORTED_LOCATION "${mpg123_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${MPG123_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${mpg123_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${MPG123_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${mpg123_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${MPG123_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${mpg123_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${MPG123_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${mpg123_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${mpg123_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -0,0 +1,44 @@
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_VORBIS QUIET vorbisfile)
find_library(Vorbis_vorbisfile_LIBRARY
NAMES vorbisfile
HINTS ${PC_VORBIS_LIBDIR}
)
find_path(Vorbis_vorbisfile_INCLUDE_PATH
NAMES vorbis/vorbisfile.h
HINTS ${PC_VORBIS_INCLUDEDIR}
)
if(PC_VORBIS_FOUND)
get_flags_from_pkg_config("${Vorbis_vorbisfile_LIBRARY}" "PC_VORBIS" "_vorbisfile")
endif()
set(Vorbis_vorbisfile_COMPILE_OPTIONS "${_vorbisfile_compile_options}" CACHE STRING "Extra compile options of vorbisfile")
set(Vorbis_vorbisfile_LINK_LIBRARIES "${_vorbisfile_link_libraries}" CACHE STRING "Extra link libraries of vorbisfile")
set(Vorbis_vorbisfile_LINK_OPTIONS "${_vorbisfile_link_options}" CACHE STRING "Extra link flags of vorbisfile")
set(Vorbis_vorbisfile_LINK_DIRECTORIES "${_vorbisfile_link_directories}" CACHE PATH "Extra link directories of vorbisfile")
find_package_handle_standard_args(Vorbis
REQUIRED_VARS Vorbis_vorbisfile_LIBRARY Vorbis_vorbisfile_INCLUDE_PATH
)
if (Vorbis_FOUND)
if (NOT TARGET Vorbis::vorbisfile)
add_library(Vorbis::vorbisfile UNKNOWN IMPORTED)
set_target_properties(Vorbis::vorbisfile PROPERTIES
IMPORTED_LOCATION "${Vorbis_vorbisfile_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${Vorbis_vorbisfile_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${Vorbis_vorbisfile_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${Vorbis_vorbisfile_LINK_LIBRARIES}"
INTERFACE_LINK_OPTIONS "${Vorbis_vorbisfile_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${Vorbis_vorbisfile_LINK_DIRECTORIES}"
)
endif()
endif()

View file

@ -0,0 +1,48 @@
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_GME QUIET libgme)
find_library(gme_LIBRARY
NAMES gme
HINTS ${PC_GME_LIBDIR}
)
find_path(gme_INCLUDE_PATH
NAMES gme/gme.h
HINTS ${PC_GME_INCLUDEDIR}
)
if(PC_GME_FOUND)
get_flags_from_pkg_config("${gme_LIBRARY}" "PC_GME" "_gme")
endif()
set(gme_COMPILE_OPTIONS "${_gme_compile_options}" CACHE STRING "Extra compile options of gme")
set(gme_LINK_LIBRARIES "${_gme_link_libraries}" CACHE STRING "Extra link libraries of gme")
set(gme_LINK_OPTIONS "${_gme_link_options}" CACHE STRING "Extra link flags of gme")
set(gme_LINK_DIRECTORIES "${_gme_link_directories}" CACHE PATH "Extra link directories of gme")
find_package_handle_standard_args(gme
REQUIRED_VARS gme_LIBRARY gme_INCLUDE_PATH
)
if(gme_FOUND)
set(gme_dirs ${gme_INCLUDE_PATH})
if(EXISTS "${gme_INCLUDE_PATH}/gme")
list(APPEND gme_dirs "${gme_INCLUDE_PATH}/gme")
endif()
if(NOT TARGET gme::gme)
add_library(gme::gme UNKNOWN IMPORTED)
set_target_properties(gme::gme PROPERTIES
IMPORTED_LOCATION "${gme_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${gme_dirs}"
INTERFACE_COMPILE_OPTIONS "${gme_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${gme_LINK_LIBRARIES}"
INTERFACE_LINK_OPTIONS "${gme_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${gme_LINK_DIRECTORIES}"
)
endif()
endif()

View file

@ -1,31 +1,45 @@
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_XMPLITE QUIET libxmp-lite)
find_library(libxmp_lite_LIBRARY find_library(libxmp_lite_LIBRARY
NAMES xmp NAMES xmp-lite libxmp-lite
HINTS ${PC_XMPLITE_LIBDIR}
) )
find_path(libxmp_lite_INCLUDE_PATH find_path(libxmp_lite_INCLUDE_PATH
NAMES xmp.h NAMES xmp.h
PATH_SUFFIXES libxmp-lite
HINTS ${PC_XMPLITE_INCLUDEDIR}
) )
set(libxmp_lite_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of libxmp_lite") if(PC_XMPLITE_FOUND)
get_flags_from_pkg_config("${libxmp_lite_LIBRARY}" "PC_XMPLITE" "_libxmp_lite")
endif()
set(libxmp_lite_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of libxmp_lite") set(libxmp_lite_COMPILE_OPTIONS "${_libxmp_lite_compile_options}" CACHE STRING "Extra compile options of libxmp_lite")
set(libxmp_lite_LINK_FLAGS "" CACHE STRING "Extra link flags of libxmp_lite") set(libxmp_lite_LINK_LIBRARIES "${_libxmp_lite_link_libraries}" CACHE STRING "Extra link libraries of libxmp_lite")
find_package_handle_standard_args(libxmp_lite set(libxmp_lite_LINK_OPTIONS "${_libxmp_lite_link_options}" CACHE STRING "Extra link flags of libxmp_lite")
set(libxmp_lite_LINK_DIRECTORIES "${_libxmp_lite_link_directories}" CACHE PATH "Extra link directories of libxmp_lite")
find_package_handle_standard_args(libxmp-lite
REQUIRED_VARS libxmp_lite_LIBRARY libxmp_lite_INCLUDE_PATH REQUIRED_VARS libxmp_lite_LIBRARY libxmp_lite_INCLUDE_PATH
) )
if(libxmp_lite_FOUND) if(libxmp-lite_FOUND)
if(NOT TARGET libxmp-lite::libxmp-lite) if(NOT TARGET libxmp-lite::libxmp-lite)
add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED) add_library(libxmp-lite::libxmp-lite UNKNOWN IMPORTED)
set_target_properties(libxmp_lite::libxmp_lite-shared PROPERTIES set_target_properties(libxmp-lite::libxmp-lite PROPERTIES
IMPORTED_LOCATION "${libxmp_lite_LIBRARY}" IMPORTED_LOCATION "${libxmp_lite_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${libxmp_lite_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${libxmp_lite_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${libxmp_lite_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${libxmp_lite_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${libxmp_lite_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${libxmp_lite_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${libxmp_lite_LINK_DIRECTORIES}"
) )
endif()
endif() endif()
endif() endif()

View file

@ -1,16 +1,29 @@
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_XMP QUIET libxmp)
find_library(libxmp_LIBRARY find_library(libxmp_LIBRARY
NAMES xmp NAMES xmp
HINTS ${PC_XMP_LIBDIR}
) )
find_path(libxmp_INCLUDE_PATH find_path(libxmp_INCLUDE_PATH
NAMES xmp.h NAMES xmp.h
HINTS ${PC_XMP_INCLUDEDIR}
) )
set(libxmp_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of libxmp") if(PC_XMP_FOUND)
get_flags_from_pkg_config("${libxmp_LIBRARY}" "PC_XMP" "_libxmp")
endif()
set(libxmp_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of libxmp") set(libxmp_COMPILE_OPTIONS "${_libxmp_compile_options}" CACHE STRING "Extra compile options of libxmp")
set(libxmp_LINK_FLAGS "" CACHE STRING "Extra link flags of libxmp") set(libxmp_LINK_LIBRARIES "${_libxmp_link_libraries}" CACHE STRING "Extra link libraries of libxmp")
set(libxmp_LINK_OPTIONS "${_libxmp_link_options}" CACHE STRING "Extra link flags of libxmp")
set(libxmp_LINK_DIRECTORIES "${_libxmp_link_directories}" CACHE PATH "Extra link flags of libxmp")
find_package_handle_standard_args(libxmp find_package_handle_standard_args(libxmp
REQUIRED_VARS libxmp_LIBRARY libxmp_INCLUDE_PATH REQUIRED_VARS libxmp_LIBRARY libxmp_INCLUDE_PATH
@ -24,7 +37,8 @@ if(libxmp_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${libxmp_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${libxmp_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${libxmp_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${libxmp_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${libxmp_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${libxmp_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${libxmp_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${libxmp_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,5 +1,8 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_MODPLUG QUIET libmodplug)
find_library(modplug_LIBRARY find_library(modplug_LIBRARY
NAMES modplug NAMES modplug
) )
@ -8,11 +11,17 @@ find_path(modplug_INCLUDE_PATH
NAMES libmodplug/modplug.h NAMES libmodplug/modplug.h
) )
set(modplug_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of modplug") if(PC_MODPLUG_FOUND)
get_flags_from_pkg_config("${modplug_LIBRARY}" "PC_MODPLUG" "_modplug")
endif()
set(modplug_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of modplug") set(modplug_COMPILE_OPTIONS "${_modplug_compile_options}" CACHE STRING "Extra compile options of modplug")
set(modplug_LINK_FLAGS "" CACHE STRING "Extra link flags of modplug") set(modplug_LINK_LIBRARIES "${_modplug_link_libraries}" CACHE STRING "Extra link libraries of modplug")
set(modplug_LINK_OPTIONS "${_modplug_link_options}" CACHE STRING "Extra link flags of modplug")
set(modplug_LINK_DIRECTORIES "${_modplug_link_directories}" CACHE PATH "Extra link directories of modplug")
find_package_handle_standard_args(modplug find_package_handle_standard_args(modplug
REQUIRED_VARS modplug_LIBRARY modplug_INCLUDE_PATH REQUIRED_VARS modplug_LIBRARY modplug_INCLUDE_PATH
@ -27,7 +36,8 @@ if (modplug_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${modplug_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${modplug_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${modplug_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${modplug_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${modplug_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${modplug_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${modplug_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${modplug_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${modplug_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,37 +1,49 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_library(opusfile_LIBRARY find_package(PkgConfig QUIET)
pkg_check_modules(PC_OPUSFILE QUIET opusfile)
find_library(OpusFile_LIBRARY
NAMES opusfile NAMES opusfile
HINTS ${PC_OPUSFILE_LIBDIR}
) )
set(opusfile_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of opusfile") find_path(OpusFile_INCLUDE_PATH
set(opusfile_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of opusfile")
set(opusfile_LINK_FLAGS "" CACHE STRING "Extra link flags of opusfile")
find_path(opusfile_INCLUDE_PATH
NAMES opusfile.h NAMES opusfile.h
PATH_SUFFIXES opus PATH_SUFFIXES opus
HINTS ${PC_OPUSFILE_INCLUDEDIR}
) )
find_package_handle_standard_args(opusfile if(PC_OPUSFILE_FOUND)
REQUIRED_VARS opusfile_LIBRARY opusfile_INCLUDE_PATH get_flags_from_pkg_config("${OpusFile_LIBRARY}" "PC_OPUSFILE" "_opusfile")
endif()
set(OpusFile_COMPILE_OPTIONS "${_opusfile_compile_options}" CACHE STRING "Extra compile options of opusfile")
set(OpusFile_LINK_LIBRARIES "${_opusfile_link_libraries}" CACHE STRING "Extra link libraries of opusfile")
set(OpusFile_LINK_OPTIONS "${_opusfile_link_options}" CACHE STRING "Extra link flags of opusfile")
set(OpusFile_LINK_DIRECTORIES "${_opusfile_link_directories}" CACHE PATH "Extra link directories of opusfile")
find_package_handle_standard_args(OpusFile
REQUIRED_VARS OpusFile_LIBRARY OpusFile_INCLUDE_PATH
) )
if (opusfile_FOUND) if (OpusFile_FOUND)
set(opusfile_dirs ${opusfile_INCLUDE_PATH}) set(OpusFile_dirs ${OpusFile_INCLUDE_PATH})
if(EXISTS "${opusfile_INCLUDE_PATH}/opus") if(EXISTS "${OpusFile_INCLUDE_PATH}/opus")
list(APPEND opusfile_dirs "${opusfile_INCLUDE_PATH}/opus") list(APPEND OpusFile_dirs "${OpusFile_INCLUDE_PATH}/opus")
endif() endif()
if (NOT TARGET opusfile::opusfile) if (NOT TARGET OpusFile::opusfile)
add_library(opusfile::opusfile UNKNOWN IMPORTED) add_library(OpusFile::opusfile UNKNOWN IMPORTED)
set_target_properties(opusfile::opusfile PROPERTIES set_target_properties(OpusFile::opusfile PROPERTIES
IMPORTED_LOCATION "${opusfile_LIBRARY}" IMPORTED_LOCATION "${OpusFile_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${opusfile_dirs}" INTERFACE_INCLUDE_DIRECTORIES "${OpusFile_dirs}"
INTERFACE_COMPILE_OPTIONS "${opusfile_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${OpusFile_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${opusfile_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${OpusFile_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${opusfile_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${OpusFile_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${OpusFile_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,18 +1,29 @@
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_TREMOR QUIET vorbisidec)
find_library(tremor_LIBRARY find_library(tremor_LIBRARY
NAMES vorbisidec libvorbisidec NAMES vorbisidec libvorbisidec
HINTS ${PC_TREMOR_LIBDIR}
) )
find_path(tremor_INCLUDE_PATH find_path(tremor_INCLUDE_PATH
NAMES tremor/ivorbisfile.h NAMES tremor/ivorbisfile.h
HINTS ${PC_TREMOR_INCLUDEDIR}
) )
set(tremor_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of vorbis") if(PC_TREMOR_FOUND)
get_flags_from_pkg_config("${tremor_LIBRARY}" "PC_TREMOR" "_tremor")
endif()
set(tremor_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of vorbis") set(tremor_COMPILE_OPTIONS "${_tremor_compile_options}" CACHE STRING "Extra compile options of vorbis")
set(tremor_LINK_FLAGS "" CACHE STRING "Extra link flags of vorbis") set(tremor_LINK_LIBRARIES "${_tremor_link_libraries}" CACHE STRING "Extra link libraries of vorbis")
set(tremor_LINK_OPTIONS "${_tremor_link_options}" CACHE STRING "Extra link flags of vorbis")
set(tremor_LINK_DIRECTORIES "${_tremor_link_directories}" CACHE PATH "Extra link directories of vorbis")
find_package_handle_standard_args(tremor find_package_handle_standard_args(tremor
REQUIRED_VARS tremor_LIBRARY tremor_INCLUDE_PATH REQUIRED_VARS tremor_LIBRARY tremor_INCLUDE_PATH
@ -26,7 +37,8 @@ if (tremor_FOUND)
INTERFACE_INCLUDE_DIRECTORIES "${tremor_INCLUDE_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${tremor_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${tremor_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${tremor_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${tremor_LINK_LIBRARIES}" INTERFACE_LINK_LIBRARIES "${tremor_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${tremor_LINK_FLAGS}" INTERFACE_LINK_OPTIONS "${tremor_LINK_OPTIONS}"
INTERFACE_LINK_DIRECTORIES "${tremor_LINK_DIRECTORIES}"
) )
endif() endif()
endif() endif()

View file

@ -1,32 +0,0 @@
include(FindPackageHandleStandardArgs)
find_library(vorbisfile_LIBRARY
NAMES vorbisfile
)
set(vorbisfile_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of vorbisfile")
set(vorbisfile_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of vorbisfile")
set(vorbisfile_LINK_FLAGS "" CACHE STRING "Extra link flags of vorbisfile")
find_path(vorbisfile_INCLUDE_PATH
NAMES vorbis/vorbisfile.h
)
find_package_handle_standard_args(vorbisfile
REQUIRED_VARS vorbisfile_LIBRARY vorbisfile_INCLUDE_PATH
)
if (vorbisfile_FOUND)
if (NOT TARGET vorbisfile::vorbisfile)
add_library(vorbisfile::vorbisfile UNKNOWN IMPORTED)
set_target_properties(vorbisfile::vorbisfile PROPERTIES
IMPORTED_LOCATION "${vorbisfile_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${vorbisfile_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${vorbisfile_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${vorbisfile_LINK_LIBRARIES}"
INTERFACE_LINK_FLAGS "${vorbisfile_LINK_FLAGS}"
)
endif()
endif()

View file

@ -0,0 +1,37 @@
include(FindPackageHandleStandardArgs)
if(WIN32)
set(wavpack_find_names wavpack libwavpack wavpackdll)
else()
set(wavpack_find_names wavpack)
endif()
find_library(wavpack_LIBRARY
NAMES ${wavpack_find_names}
)
find_path(wavpack_INCLUDE_PATH
NAMES wavpack/wavpack.h
)
set(wavpack_COMPILE_OPTIONS "" CACHE STRING "Extra compile options of wavpack")
set(wavpack_LINK_LIBRARIES "" CACHE STRING "Extra link libraries of wavpack")
set(wavpack_LINK_OPTIONS "" CACHE STRING "Extra link flags of wavpack")
find_package_handle_standard_args(wavpack
REQUIRED_VARS wavpack_LIBRARY wavpack_INCLUDE_PATH
)
if (wavpack_FOUND)
if (NOT TARGET WavPack::WavPack)
add_library(WavPack::WavPack UNKNOWN IMPORTED)
set_target_properties(WavPack::WavPack PROPERTIES
IMPORTED_LOCATION "${wavpack_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${wavpack_INCLUDE_PATH}"
INTERFACE_COMPILE_OPTIONS "${wavpack_COMPILE_OPTIONS}"
INTERFACE_LINK_LIBRARIES "${wavpack_LINK_LIBRARIES}"
INTERFACE_LINK_OPTIONS "${wavpack_LINK_OPTIONS}"
)
endif()
endif()

View file

@ -0,0 +1,34 @@
# Helper for Find modules
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
else()
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
set(_link_libraries ${_pc_prefix}_LIBRARIES)
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
endif()
# The *_LIBRARIES lists always start with the library itself
list(POP_FRONT "${_link_libraries}")
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
set(${_out_prefix}_compile_options
"${${_cflags}}"
PARENT_SCOPE)
set(${_out_prefix}_link_libraries
"${${_link_libraries}}"
PARENT_SCOPE)
set(${_out_prefix}_link_options
"${_filtered_link_options}"
PARENT_SCOPE)
set(${_out_prefix}_link_directories
"${${_library_dirs}}"
PARENT_SCOPE)
endfunction()

View file

@ -60,7 +60,7 @@ add_library(SDL2_mixer::SDL2_mixer-static STATIC IMPORTED)
set_target_properties(SDL2_mixer::SDL2_mixer-static PROPERTIES set_target_properties(SDL2_mixer::SDL2_mixer-static PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2"
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:>;\$<LINK_ONLY:opusfile::opusfile>;\$<LINK_ONLY:vorbisfile::vorbisfile>;\$<LINK_ONLY:FLAC>;\$<LINK_ONLY:modplug::modplug>;\$<LINK_ONLY:libxmp::libxmp>;\$<LINK_ONLY:MPG123::mpg123>;\$<LINK_ONLY:FluidSynth::FluidSynth>" INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:>;\$<LINK_ONLY:OpusFile::opusfile>;\$<LINK_ONLY:Vorbis::vorbisfile>;\$<LINK_ONLY:FLAC::FLAC>;\$<LINK_ONLY:gme::gme>;\$<LINK_ONLY:modplug::modplug>;\$<LINK_ONLY:libxmp::libxmp>;\$<LINK_ONLY:MPG123::libmpg123>;\$<LINK_ONLY:FluidSynth::libfluidsynth>;-Wl,-framework,AudioToolbox;-Wl,-framework,AudioUnit;-Wl,-framework,CoreServices;\$<LINK_ONLY:WavPack::WavPack>"
) )
if(CMAKE_VERSION VERSION_LESS 2.8.12) if(CMAKE_VERSION VERSION_LESS 2.8.12)

View file

@ -12,16 +12,18 @@ set(SDL2MIXER_VENDORED OFF)
set(SDL2MIXER_CMD OFF) set(SDL2MIXER_CMD OFF)
set(SDL2MIXER_FLAC_LIBFLAC ON) set(SDL2MIXER_FLAC_LIBFLAC YES)
set(SDL2MIXER_FLAC_DRFLAC ON) set(SDL2MIXER_FLAC_DRFLAC ON)
set(SDL2MIXER_GME YES)
set(SDL2MIXER_MOD ON) set(SDL2MIXER_MOD ON)
set(SDL2MIXER_MOD_MODPLUG ON) set(SDL2MIXER_MOD_MODPLUG YES)
set(SDL2MIXER_MOD_XMP YES) set(SDL2MIXER_MOD_XMP ON)
set(SDL2MIXER_MOD_XMP_LITE OFF) set(SDL2MIXER_MOD_XMP_LITE OFF)
set(SDL2MIXER_MP3 ON) set(SDL2MIXER_MP3 ON)
set(SDL2MIXER_MP3_DRMP3 ON) set(SDL2MIXER_MP3_MINIMP3 ON)
set(SDL2MIXER_MP3_MPG123 YES) set(SDL2MIXER_MP3_MPG123 YES)
set(SDL2MIXER_MIDI ON) set(SDL2MIXER_MIDI ON)
@ -38,6 +40,8 @@ set(SDL2MIXER_VORBIS_VORBISFILE ON)
set(SDL2MIXER_WAVE ON) set(SDL2MIXER_WAVE ON)
set(SDL2MIXER_WAVPACK ON)
set(SDL2MIXER_SDL2_REQUIRED_VERSION 2.0.9) set(SDL2MIXER_SDL2_REQUIRED_VERSION 2.0.9)
if(NOT SDL2MIXER_VENDORED) if(NOT SDL2MIXER_VENDORED)
@ -51,12 +55,21 @@ endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer-static-targets.cmake") if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer-static-targets.cmake")
include(CMakeFindDependencyMacro)
include(PkgConfigHelper)
if(NOT DEFINED CMAKE_FIND_PACKAGE_PREFER_CONFIG)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
endif()
include(CMakeFindDependencyMacro)
if(SDL2MIXER_FLAC_LIBFLAC AND NOT SDL2MIXER_VENDORED AND NOT TARGET FLAC::FLAC) if(SDL2MIXER_FLAC_LIBFLAC AND NOT SDL2MIXER_VENDORED AND NOT TARGET FLAC::FLAC)
find_dependency(FLAC) find_dependency(FLAC)
endif() endif()
if(SDL2MIXER_GME AND NOT SDL2MIXER_VENDORED AND NOT TARGET gme::gme)
find_dependency(gme)
endif()
if(SDL2MIXER_MOD_MODPLUG AND NOT SDL2MIXER_VENDORED AND NOT TARGET modplug::modplug) if(SDL2MIXER_MOD_MODPLUG AND NOT SDL2MIXER_VENDORED AND NOT TARGET modplug::modplug)
find_dependency(modplug) find_dependency(modplug)
endif() endif()
@ -70,10 +83,10 @@ include(CMakeFindDependencyMacro)
endif() endif()
if(SDL2MIXER_MP3_MPG123 AND NOT SDL2MIXER_VENDORED AND NOT TARGET MPG123::mpg123) if(SDL2MIXER_MP3_MPG123 AND NOT SDL2MIXER_VENDORED AND NOT TARGET MPG123::mpg123)
find_dependency(MPG123) find_dependency(mpg123)
endif() endif()
if(SDL2MIXER_MIDI_FLUIDSYNTH AND NOT SDL2MIXER_VENDORED AND NOT TARGET FluidSynth::FluidSynth) if(SDL2MIXER_MIDI_FLUIDSYNTH AND NOT SDL2MIXER_VENDORED AND NOT TARGET FluidSynth::libfluidsynth)
find_dependency(FluidSynth) find_dependency(FluidSynth)
endif() endif()
@ -81,8 +94,16 @@ include(CMakeFindDependencyMacro)
find_dependency(tremor) find_dependency(tremor)
endif() endif()
if(SDL2MIXER_VORBIS_VORBISFILE AND NOT SDL2MIXER_VENDORED AND NOT TARGET vorbisfile::vorbisfile) if(SDL2MIXER_VORBIS_VORBISFILE AND NOT SDL2MIXER_VENDORED AND NOT TARGET Vorbis::vorbisfile)
find_dependency(vorbisfile) find_dependency(Vorbis)
endif()
if(SDL2MIXER_OPUS AND NOT SDL2MIXER_VENDORED AND NOT TARGET OpusFile::opusfile)
find_dependency(OpusFile)
endif()
if(SDL2MIXER_WAVPACK AND NOT SDL2MIXER_VENDORED AND NOT TARGET WavPack::WavPack)
find_dependency(wavpack)
endif() endif()
if((NOT SDL2MIXER_VENDORED AND SDL2MIXER_MOD_MODPLUG) OR (HAIKU AND SDL2MIXER_MIDI_NATIVE)) if((NOT SDL2MIXER_VENDORED AND SDL2MIXER_MOD_MODPLUG) OR (HAIKU AND SDL2MIXER_MIDI_NATIVE))

View file

@ -7,7 +7,7 @@
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
# The variable CVF_VERSION must be set before calling configure_file(). # The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "2.6.3") set(PACKAGE_VERSION "2.8.0")
if (PACKAGE_FIND_VERSION_RANGE) if (PACKAGE_FIND_VERSION_RANGE)
# Package version must be in the requested version range # Package version must be in the requested version range

Binary file not shown.

View file

@ -5,9 +5,9 @@ includedir=${prefix}/include
Name: SDL2_mixer Name: SDL2_mixer
Description: mixer library for Simple DirectMedia Layer Description: mixer library for Simple DirectMedia Layer
Version: 2.6.3 Version: 2.8.0
Requires: sdl2 >= 2.0.9 Requires: sdl2 >= 2.0.9
Requires.private: flac fluidsynth libmodplug libmpg123 libxmp opusfile vorbisfile
Libs: -L${libdir} -lSDL2_mixer Libs: -L${libdir} -lSDL2_mixer
Cflags: -I${includedir}/SDL2
Requires.private: opusfile vorbisfile flac libgme libmodplug libxmp libmpg123 fluidsynth wavpack
Libs.private: Libs.private:
Cflags: -I${includedir} -I${includedir}/SDL2