# Copyright (c) 2026 Dominic Masters # # This software is released under the MIT License. # https://opensource.org/licenses/MIT # NOTE: libmad itself is GPL-licensed (see https://www.underbit.com/products/mad/), # not MIT like the rest of this project. Any binary linking it must comply # with the GPL - a deliberate tradeoff accepted for MP3 decode correctness # (see audiostreammp3decodersw.c's own comment on why minimp3 wasn't enough). find_path(LIBMAD_INCLUDE_DIR NAMES mad.h) mark_as_advanced(LIBMAD_INCLUDE_DIR) find_library(LIBMAD_LIBRARY NAMES mad) mark_as_advanced(LIBMAD_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( libmad REQUIRED_VARS LIBMAD_LIBRARY LIBMAD_INCLUDE_DIR ) if(libmad_FOUND AND NOT TARGET libmad::mad) add_library(libmad::mad UNKNOWN IMPORTED) set_target_properties(libmad::mad PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${LIBMAD_INCLUDE_DIR} IMPORTED_LOCATION ${LIBMAD_LIBRARY} ) endif()