set(libmt32emu_OLD_MODULE_PATH ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
if(MT32Emu_FIND_QUIETLY)
  set(libmt32emu_EXT_PACKAGE_FIND_MODE QUIET)
endif()
find_package(${libmt32emu_EXT_DEPENDENCY} ${libmt32emu_EXT_PACKAGE_FIND_MODE} MODULE)
set(CMAKE_MODULE_PATH ${libmt32emu_OLD_MODULE_PATH})
unset(libmt32emu_OLD_MODULE_PATH)
unset(libmt32emu_EXT_PACKAGE_FIND_MODE)

list(GET libmt32emu_EXT_DEPENDENCY 0 libmt32emu_EXT_PACKAGE_NAME)
if(NOT ${libmt32emu_EXT_PACKAGE_NAME}_FOUND)
  if(MT32Emu_FIND_REQUIRED)
    message(FATAL_ERROR "MT32Emu is missing required dependency: ${libmt32emu_EXT_PACKAGE_NAME}")
  else()
    set(MT32Emu_FOUND FALSE)
  endif()
endif()
unset(libmt32emu_EXT_PACKAGE_NAME)
