diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2016-10-18 13:23:32.000000000 -0700
+++ b/CMakeLists.txt	2016-11-16 22:33:24.931252608 -0800
@@ -4,39 +4,10 @@
 list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
 
 find_package(Kodi REQUIRED)
+find_package(libretro-desmume REQUIRED)
 
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-  set(LIBRETRO_DEBUG DEBUG=1)
-endif()
-
-if("${CORE_SYSTEM_NAME}" STREQUAL "windows")
-  set(BUILD_COMMAND mingw32-make -f Makefile.libretro platform=win ${LIBRETRO_DEBUG})
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "linux")
-  set(BUILD_COMMAND make -f Makefile.libretro ${LIBRETRO_DEBUG})
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "darwin")
-  set(BUILD_COMMAND make -f Makefile.libretro platform=osx ${LIBRETRO_DEBUG})
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "ios")
-  # TODO
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "android")
-  # TODO
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "rbpi")
-  # TODO
-elseif("${CORE_SYSTEM_NAME}" STREQUAL "freebsd")
-# TODO
-endif()
-
-include(ExternalProject)
-externalproject_add(desmume
-                    GIT_REPOSITORY https://github.com/libretro/desmume-libretro
-                    GIT_TAG 40f9af5
-                    PREFIX desmume
-                    CONFIGURE_COMMAND ""
-                    INSTALL_COMMAND ""
-                    BUILD_COMMAND ${BUILD_COMMAND}
-                    BUILD_IN_SOURCE 1)
-
-set(DESMUME_CUSTOM_BINARY ${PROJECT_BINARY_DIR}/desmume/src/desmume/desmume_libretro${CMAKE_SHARED_LIBRARY_SUFFIX}
+set(DEPLIBS desmume)
+set(DESMUME_CUSTOM_BINARY ${DESMUME_LIB}
                           ${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
 
 build_addon(${PROJECT_NAME} DESMUME DEPLIBS)
-add_dependencies(${PROJECT_NAME} desmume)
