# This module defines:
#
#  SDL2_MIXER_INCLUDE_DIR
#  SDL2_MIXER_LIBRARY
#  SDL2_MIXER_FOUND
#

FIND_PATH(SDL2_MIXER_INCLUDE_DIR NAMES SDL_mixer.h PATH_SUFFIXES SDL2)

FIND_LIBRARY(SDL2_MIXER_LIBRARY NAMES SDL2_mixer)

INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(sdl2_mixer REQUIRED_VARS SDL2_MIXER_LIBRARY SDL2_MIXER_INCLUDE_DIR)

MARK_AS_ADVANCED(SDL2_MIXER_INCLUDE_DIR SDL2_MIXER_LIBRARY)

if(SDL2_MIXER_FOUND AND NOT TARGET sdl2_mixer::sdl2_mixer)
    add_library(sdl2_mixer::sdl2_mixer INTERFACE IMPORTED)
    set_target_properties(sdl2_mixer::sdl2_mixer PROPERTIES
        INTERFACE_INCLUDE_DIRECTORIES "${SDL2_MIXER_INCLUDE_DIR}"
	INTERFACE_LINK_LIBRARIES "${SDL2_MIXER_LIBRARY}"
    )
endif()
