CMakeLists.txt 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. cmake_minimum_required(VERSION 3.15)
  2. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
  3. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
  4. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/find-modules")
  5. include(DownloadExternals)
  6. include(CMakeDependentOption)
  7. project(yuzu)
  8. # Set bundled sdl2/qt as dependent options.
  9. # OFF by default, but if ENABLE_SDL2 and MSVC are true then ON
  10. option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
  11. CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON "ENABLE_SDL2;MSVC" OFF)
  12. # On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion
  13. CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF)
  14. option(ENABLE_QT "Enable the Qt frontend" ON)
  15. option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
  16. CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
  17. option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
  18. option(YUZU_USE_BUNDLED_BOOST "Download bundled Boost" OFF)
  19. option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF)
  20. option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
  21. option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
  22. option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
  23. option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
  24. # Default to a Release build
  25. get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
  26. if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE)
  27. set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
  28. message(STATUS "Defaulting to a Release build")
  29. endif()
  30. if(EXISTS ${PROJECT_SOURCE_DIR}/hooks/pre-commit AND NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
  31. if (EXISTS ${PROJECT_SOURCE_DIR}/.git/)
  32. message(STATUS "Copying pre-commit hook")
  33. file(COPY hooks/pre-commit DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks)
  34. endif()
  35. endif()
  36. # Sanity check : Check that all submodules are present
  37. # =======================================================================
  38. function(check_submodules_present)
  39. file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules)
  40. string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
  41. foreach(module ${gitmodules})
  42. string(REGEX REPLACE "path *= *" "" module ${module})
  43. if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
  44. message(FATAL_ERROR "Git submodule ${module} not found. "
  45. "Please run: git submodule update --init --recursive")
  46. endif()
  47. endforeach()
  48. endfunction()
  49. if(EXISTS ${PROJECT_SOURCE_DIR}/.gitmodules)
  50. check_submodules_present()
  51. endif()
  52. configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc
  53. ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
  54. COPYONLY)
  55. if (ENABLE_COMPATIBILITY_LIST_DOWNLOAD AND NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
  56. message(STATUS "Downloading compatibility list for yuzu...")
  57. file(DOWNLOAD
  58. https://api.yuzu-emu.org/gamedb/
  59. "${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json" SHOW_PROGRESS)
  60. endif()
  61. if (NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
  62. file(WRITE ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json "")
  63. endif()
  64. # Detect current compilation architecture and create standard definitions
  65. # =======================================================================
  66. include(CheckSymbolExists)
  67. function(detect_architecture symbol arch)
  68. if (NOT DEFINED ARCHITECTURE)
  69. set(CMAKE_REQUIRED_QUIET 1)
  70. check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
  71. unset(CMAKE_REQUIRED_QUIET)
  72. # The output variable needs to be unique across invocations otherwise
  73. # CMake's crazy scope rules will keep it defined
  74. if (ARCHITECTURE_${arch})
  75. set(ARCHITECTURE "${arch}" PARENT_SCOPE)
  76. set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
  77. add_definitions(-DARCHITECTURE_${arch}=1)
  78. endif()
  79. endif()
  80. endfunction()
  81. if (NOT ENABLE_GENERIC)
  82. if (MSVC)
  83. detect_architecture("_M_AMD64" x86_64)
  84. detect_architecture("_M_IX86" x86)
  85. detect_architecture("_M_ARM" ARM)
  86. detect_architecture("_M_ARM64" ARM64)
  87. else()
  88. detect_architecture("__x86_64__" x86_64)
  89. detect_architecture("__i386__" x86)
  90. detect_architecture("__arm__" ARM)
  91. detect_architecture("__aarch64__" ARM64)
  92. endif()
  93. endif()
  94. if (NOT DEFINED ARCHITECTURE)
  95. set(ARCHITECTURE "GENERIC")
  96. set(ARCHITECTURE_GENERIC 1)
  97. add_definitions(-DARCHITECTURE_GENERIC=1)
  98. endif()
  99. message(STATUS "Target architecture: ${ARCHITECTURE}")
  100. if (UNIX)
  101. add_definitions(-DYUZU_UNIX=1)
  102. endif()
  103. # Configure C++ standard
  104. # ===========================
  105. # boost asio's concept usage doesn't play nicely with some compilers yet.
  106. add_definitions(-DBOOST_ASIO_DISABLE_CONCEPTS)
  107. if (MSVC)
  108. add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>)
  109. # cubeb and boost still make use of deprecated result_of.
  110. add_definitions(-D_HAS_DEPRECATED_RESULT_OF)
  111. else()
  112. set(CMAKE_CXX_STANDARD 20)
  113. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  114. endif()
  115. # Output binaries to bin/
  116. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
  117. # System imported libraries
  118. # If not found, download any missing through Conan
  119. # =======================================================================
  120. set(CONAN_CMAKE_SILENT_OUTPUT TRUE)
  121. set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
  122. if (YUZU_CONAN_INSTALLED)
  123. if (IS_MULTI_CONFIG)
  124. include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
  125. else()
  126. include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  127. endif()
  128. list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
  129. list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
  130. conan_basic_setup()
  131. message(STATUS "Adding conan installed libraries to the search path")
  132. endif()
  133. macro(yuzu_find_packages)
  134. set(options FORCE_REQUIRED)
  135. cmake_parse_arguments(FN "${options}" "" "" ${ARGN})
  136. # Cmake has a *serious* lack of 2D array or associative array...
  137. # Capitalization matters here. We need the naming to match the generated paths from Conan
  138. set(REQUIRED_LIBS
  139. # Cmake Pkg Prefix Version Conan Pkg
  140. "Catch2 2.13 catch2/2.13.0"
  141. "fmt 8.0 fmt/8.0.0"
  142. "lz4 1.8 lz4/1.9.2"
  143. "nlohmann_json 3.8 nlohmann_json/3.8.0"
  144. "ZLIB 1.2 zlib/1.2.11"
  145. "zstd 1.5 zstd/1.5.0"
  146. # can't use opus until AVX check is fixed: https://github.com/yuzu-emu/yuzu/pull/4068
  147. #"opus 1.3 opus/1.3.1"
  148. )
  149. foreach(PACKAGE ${REQUIRED_LIBS})
  150. string(REGEX REPLACE "[ \t\r\n]+" ";" PACKAGE_SPLIT ${PACKAGE})
  151. list(GET PACKAGE_SPLIT 0 PACKAGE_PREFIX)
  152. list(GET PACKAGE_SPLIT 1 PACKAGE_VERSION)
  153. list(GET PACKAGE_SPLIT 2 PACKAGE_CONAN)
  154. # This function is called twice, once to check if the packages exist on the system already
  155. # and a second time to check if conan installed them properly. The second check passes in FORCE_REQUIRED
  156. if (NOT ${PACKAGE_PREFIX}_FOUND)
  157. if (FN_FORCE_REQUIRED)
  158. find_package(${PACKAGE_PREFIX} ${PACKAGE_VERSION} REQUIRED)
  159. else()
  160. find_package(${PACKAGE_PREFIX} ${PACKAGE_VERSION})
  161. endif()
  162. endif()
  163. if (NOT ${PACKAGE_PREFIX}_FOUND)
  164. list(APPEND CONAN_REQUIRED_LIBS ${PACKAGE_CONAN})
  165. else()
  166. # Set a legacy findPackage.cmake style PACKAGE_LIBRARIES variable for subprojects that rely on this
  167. set(${PACKAGE_PREFIX}_LIBRARIES "${PACKAGE_PREFIX}::${PACKAGE_PREFIX}")
  168. endif()
  169. endforeach()
  170. unset(FN_FORCE_REQUIRED)
  171. endmacro()
  172. if (NOT YUZU_USE_BUNDLED_BOOST)
  173. find_package(Boost 1.73.0 CONFIG COMPONENTS context headers QUIET)
  174. endif()
  175. if (Boost_FOUND)
  176. set(Boost_LIBRARIES Boost::boost)
  177. # Conditionally add Boost::context only if the active version of the Conan or system Boost package provides it
  178. # The old version is missing Boost::context, so we want to avoid adding in that case
  179. # The new version requires adding Boost::context to prevent linking issues
  180. #
  181. # This one is used by Conan on subsequent CMake configures, not the first configure.
  182. if (TARGET Boost::context)
  183. list(APPEND Boost_LIBRARIES Boost::context)
  184. endif()
  185. elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR YUZU_USE_BUNDLED_BOOST)
  186. message(STATUS "Boost 1.73.0 or newer not found, falling back to externals")
  187. set(YUZU_USE_BUNDLED_BOOST ON CACHE BOOL "Download bundled Boost" FORCE)
  188. # Use yuzu Boost binaries
  189. set(Boost_EXT_NAME "boost_1_75_0")
  190. set(Boost_PATH "${CMAKE_BINARY_DIR}/externals/${Boost_EXT_NAME}")
  191. download_bundled_external("boost/" ${Boost_EXT_NAME} "")
  192. set(Boost_USE_DEBUG_RUNTIME FALSE)
  193. set(Boost_USE_STATIC_LIBS ON)
  194. find_package(Boost 1.75.0 CONFIG REQUIRED COMPONENTS context headers PATHS ${Boost_PATH} NO_DEFAULT_PATH)
  195. # Manually set the include dirs since the find_package sets it incorrectly
  196. set(Boost_INCLUDE_DIRS ${Boost_PATH}/include CACHE PATH "Path to Boost headers" FORCE)
  197. include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
  198. else()
  199. message(STATUS "Boost 1.73.0 or newer not found, falling back to Conan")
  200. list(APPEND CONAN_REQUIRED_LIBS "boost/1.73.0")
  201. endif()
  202. # Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS
  203. yuzu_find_packages()
  204. # Qt5 requires that we find components, so it doesn't fit our pretty little find package function
  205. if(ENABLE_QT)
  206. set(QT_VERSION 5.15)
  207. # We want to load the generated conan qt config so that we get the QT_ROOT var so that we can use the official
  208. # Qt5Config inside the root folder instead of the conan generated one.
  209. if(EXISTS ${CMAKE_BINARY_DIR}/qtConfig.cmake)
  210. include(${CMAKE_BINARY_DIR}/qtConfig.cmake)
  211. list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
  212. list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}")
  213. endif()
  214. # Check for system Qt on Linux, fallback to bundled Qt
  215. if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  216. if (NOT YUZU_USE_BUNDLED_QT)
  217. find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets)
  218. endif()
  219. if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT)
  220. # Check for dependencies, then enable bundled Qt download
  221. # Check that the system GLIBCXX version is compatible
  222. find_program(OBJDUMP objdump)
  223. if ("${OBJDUMP}" STREQUAL "OBJDUMP-NOTFOUND")
  224. message(FATAL_ERROR "Required program `objdump` not found.")
  225. endif()
  226. find_library(LIBSTDCXX libstdc++.so.6)
  227. execute_process(
  228. COMMAND
  229. ${OBJDUMP} -T ${LIBSTDCXX}
  230. COMMAND
  231. grep GLIBCXX_3.4.28
  232. COMMAND
  233. sed "s/[0-9a-f]*.* //"
  234. COMMAND
  235. sed "s/ .*//"
  236. COMMAND
  237. sort -u
  238. OUTPUT_VARIABLE
  239. GLIBCXX_MET
  240. )
  241. if (NOT GLIBCXX_MET)
  242. message(FATAL_ERROR "Qt too old or not found, and bundled Qt package is not \
  243. compatible with this system. Either install Qt ${QT_VERSION}, or provide the path \
  244. to Qt by setting the variable Qt5_ROOT.")
  245. endif()
  246. # Check for headers
  247. Include(FindPkgConfig REQUIRED)
  248. pkg_check_modules(QT_DEP_GLU QUIET glu>=9.0.0)
  249. if (NOT QT_DEP_GLU_FOUND)
  250. message(FATAL_ERROR "Qt bundled pacakge dependency `glu` not found. \
  251. Perhaps `libglu1-mesa-dev` needs to be installed?")
  252. endif()
  253. pkg_check_modules(QT_DEP_MESA QUIET dri>=20.0.8)
  254. if (NOT QT_DEP_MESA_FOUND)
  255. message(FATAL_ERROR "Qt bundled pacakge dependency `dri` not found. \
  256. Perhaps `mesa-common-dev` needs to be installed?")
  257. endif()
  258. # Check for X libraries
  259. set(BUNDLED_QT_REQUIREMENTS
  260. libxcb-icccm.so.4
  261. libxcb-image.so.0
  262. libxcb-keysyms.so.1
  263. libxcb-randr.so.0
  264. libxcb-render-util.so.0
  265. libxcb-render.so.0
  266. libxcb-shape.so.0
  267. libxcb-shm.so.0
  268. libxcb-sync.so.1
  269. libxcb-xfixes.so.0
  270. libxcb-xinerama.so.0
  271. libxcb-xkb.so.1
  272. libxcb.so.1
  273. libxkbcommon-x11.so.0
  274. libxkbcommon.so.0
  275. )
  276. set(UNRESOLVED_QT_DEPS "")
  277. foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
  278. find_library(BUNDLED_QT_${REQUIREMENT} ${REQUIREMENT})
  279. if ("${BUNDLED_QT_${REQUIREMENT}}" STREQUAL "BUNDLED_QT_${REQUIREMENT}-NOTFOUND")
  280. set(UNRESOLVED_QT_DEPS ${UNRESOLVED_QT_DEPS} ${REQUIREMENT})
  281. endif()
  282. unset(BUNDLED_QT_${REQUIREMENT})
  283. endforeach()
  284. unset(BUNDLED_QT_REQUIREMENTS)
  285. if (NOT "${UNRESOLVED_QT_DEPS}" STREQUAL "")
  286. message(FATAL_ERROR "Bundled Qt package missing required dependencies: ${UNRESOLVED_QT_DEPS}")
  287. endif()
  288. set(YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE)
  289. endif()
  290. if (YUZU_USE_BUNDLED_QT)
  291. # Binary package currently does not support Qt webengine, so make sure it's disabled
  292. set(YUZU_USE_QT_WEB_ENGINE OFF CACHE BOOL "Use Qt Webengine" FORCE)
  293. endif()
  294. endif()
  295. set(YUZU_QT_NO_CMAKE_SYSTEM_PATH)
  296. # Workaround for an issue where conan tries to build Qt from scratch instead of download prebuilt binaries
  297. set(QT_PREFIX_HINT)
  298. if(YUZU_USE_BUNDLED_QT)
  299. if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
  300. set(QT_BUILD qt-5.15.2-msvc2019_64)
  301. elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64)
  302. set(QT_BUILD qt5_5_15_2)
  303. else()
  304. message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")
  305. endif()
  306. if (DEFINED QT_BUILD)
  307. download_bundled_external("qt/" ${QT_BUILD} QT_PREFIX)
  308. endif()
  309. set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
  310. set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH")
  311. endif()
  312. find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
  313. if (YUZU_USE_QT_WEB_ENGINE)
  314. find_package(Qt5 COMPONENTS WebEngineCore WebEngineWidgets)
  315. endif()
  316. if (ENABLE_QT_TRANSLATION)
  317. find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT})
  318. endif()
  319. endif()
  320. # find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the yuzu_find_package
  321. if (ENABLE_SDL2)
  322. if (YUZU_USE_BUNDLED_SDL2)
  323. # Detect toolchain and platform
  324. if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
  325. set(SDL2_VER "SDL2-2.0.16")
  326. else()
  327. message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.")
  328. endif()
  329. if (DEFINED SDL2_VER)
  330. download_bundled_external("sdl2/" ${SDL2_VER} SDL2_PREFIX)
  331. endif()
  332. set(SDL2_FOUND YES)
  333. set(SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers")
  334. set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library")
  335. set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll")
  336. add_library(SDL2 INTERFACE)
  337. target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
  338. target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
  339. elseif (YUZU_USE_EXTERNAL_SDL2)
  340. message(STATUS "Using SDL2 from externals.")
  341. else()
  342. find_package(SDL2 2.0.16 REQUIRED)
  343. # Some installations don't set SDL2_LIBRARIES
  344. if("${SDL2_LIBRARIES}" STREQUAL "")
  345. message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
  346. set(SDL2_LIBRARIES "SDL2::SDL2")
  347. endif()
  348. include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
  349. add_library(SDL2 INTERFACE)
  350. target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
  351. endif()
  352. endif()
  353. # Install any missing dependencies with conan install
  354. if (CONAN_REQUIRED_LIBS)
  355. message(STATUS "Packages ${CONAN_REQUIRED_LIBS} not found!")
  356. # Use Conan to fetch the libraries that aren't found
  357. # Download conan.cmake automatically, you can also just copy the conan.cmake file
  358. if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
  359. message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
  360. file(DOWNLOAD "https://github.com/conan-io/cmake-conan/raw/v0.15/conan.cmake"
  361. "${CMAKE_BINARY_DIR}/conan.cmake")
  362. endif()
  363. include(${CMAKE_BINARY_DIR}/conan.cmake)
  364. conan_check(VERSION 1.24.0 REQUIRED)
  365. # Manually add iconv to fix a dep conflict between qt and sdl2
  366. # We don't need to add it through find_package or anything since the other two can find it just fine
  367. if ("${CONAN_REQUIRED_LIBS}" MATCHES "qt" AND "${CONAN_REQUIRED_LIBS}" MATCHES "sdl")
  368. list(APPEND CONAN_REQUIRED_LIBS "libiconv/1.16")
  369. endif()
  370. if (IS_MULTI_CONFIG)
  371. conan_cmake_run(REQUIRES ${CONAN_REQUIRED_LIBS}
  372. OPTIONS ${CONAN_LIB_OPTIONS}
  373. BUILD missing
  374. CONFIGURATION_TYPES "Release;Debug"
  375. GENERATORS cmake_multi cmake_find_package_multi)
  376. include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
  377. else()
  378. conan_cmake_run(REQUIRES ${CONAN_REQUIRED_LIBS}
  379. OPTIONS ${CONAN_LIB_OPTIONS}
  380. BUILD missing
  381. GENERATORS cmake cmake_find_package_multi)
  382. include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  383. endif()
  384. list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
  385. list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
  386. conan_basic_setup()
  387. set(YUZU_CONAN_INSTALLED TRUE CACHE BOOL "If true, the following builds will add conan to the lib search path" FORCE)
  388. # Now that we've installed what we are missing, try to locate them again,
  389. # this time with required, so we bail if its not found.
  390. yuzu_find_packages(FORCE_REQUIRED)
  391. if (NOT Boost_FOUND)
  392. find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
  393. set(Boost_LIBRARIES Boost::boost)
  394. # Conditionally add Boost::context only if the active version of the Conan Boost package provides it
  395. # The old version is missing Boost::context, so we want to avoid adding in that case
  396. # The new version requires adding Boost::context to prevent linking issues
  397. if (TARGET Boost::context)
  398. list(APPEND Boost_LIBRARIES Boost::context)
  399. endif()
  400. endif()
  401. # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function
  402. if(ENABLE_QT)
  403. list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
  404. list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}")
  405. find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets)
  406. if (YUZU_USE_QT_WEB_ENGINE)
  407. find_package(Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets)
  408. endif()
  409. endif()
  410. endif()
  411. # Reexport some targets that are named differently when using the upstream CmakeConfig vs the generated Conan config
  412. # In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL
  413. # Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external
  414. if (TARGET Boost::Boost)
  415. set_target_properties(Boost::Boost PROPERTIES IMPORTED_GLOBAL TRUE)
  416. add_library(Boost::boost ALIAS Boost::Boost)
  417. add_library(boost ALIAS Boost::Boost)
  418. elseif (TARGET Boost::boost)
  419. set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE)
  420. add_library(boost ALIAS Boost::boost)
  421. endif()
  422. # Ensure libusb is properly configured (based on dolphin libusb include)
  423. if(NOT APPLE AND NOT YUZU_USE_BUNDLED_LIBUSB)
  424. include(FindPkgConfig)
  425. if (PKG_CONFIG_FOUND AND NOT CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
  426. pkg_check_modules(LIBUSB QUIET libusb-1.0>=1.0.24)
  427. else()
  428. find_package(LibUSB)
  429. endif()
  430. if (LIBUSB_FOUND)
  431. add_library(usb INTERFACE)
  432. target_include_directories(usb INTERFACE "${LIBUSB_INCLUDE_DIRS}")
  433. target_link_libraries(usb INTERFACE "${LIBUSB_LIBRARIES}")
  434. else()
  435. message(WARNING "libusb not found, falling back to externals")
  436. set(YUZU_USE_BUNDLED_LIBUSB ON)
  437. endif()
  438. endif()
  439. # List of all FFmpeg components required
  440. set(FFmpeg_COMPONENTS
  441. avcodec
  442. avutil
  443. swscale)
  444. if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  445. Include(FindPkgConfig REQUIRED)
  446. pkg_check_modules(LIBVA libva)
  447. endif()
  448. if (NOT YUZU_USE_BUNDLED_FFMPEG)
  449. # Use system installed FFmpeg
  450. find_package(FFmpeg QUIET COMPONENTS ${FFmpeg_COMPONENTS})
  451. if (FFmpeg_FOUND)
  452. # Overwrite aggregate defines from FFmpeg module to avoid over-linking libraries.
  453. # Prevents shipping too many libraries with the AppImage.
  454. set(FFmpeg_LIBRARIES "")
  455. set(FFmpeg_INCLUDE_DIR "")
  456. foreach(COMPONENT ${FFmpeg_COMPONENTS})
  457. set(FFmpeg_LIBRARIES ${FFmpeg_LIBRARIES} ${FFmpeg_LIBRARY_${COMPONENT}} CACHE PATH "Paths to FFmpeg libraries" FORCE)
  458. set(FFmpeg_INCLUDE_DIR ${FFmpeg_INCLUDE_DIR} ${FFmpeg_INCLUDE_${COMPONENT}} CACHE PATH "Path to FFmpeg headers" FORCE)
  459. endforeach()
  460. else()
  461. message(WARNING "FFmpeg not found, falling back to externals")
  462. set(YUZU_USE_BUNDLED_FFMPEG ON)
  463. endif()
  464. endif()
  465. if (YUZU_USE_BUNDLED_FFMPEG)
  466. if (NOT WIN32)
  467. # TODO(lat9nq): Move this to externals/ffmpeg/CMakeLists.txt (and move externals/ffmpeg to
  468. # externals/ffmpeg/ffmpeg)
  469. # Build FFmpeg from externals
  470. message(STATUS "Using FFmpeg from externals")
  471. # FFmpeg has source that requires one of nasm or yasm to assemble it.
  472. # REQUIRED throws an error if not found here during configuration rather than during compilation.
  473. find_program(ASSEMBLER NAMES nasm yasm)
  474. if ("${ASSEMBLER}" STREQUAL "ASSEMBLER-NOTFOUND")
  475. message(FATAL_ERROR "One of either `nasm` or `yasm` not found but is required.")
  476. endif()
  477. find_program(AUTOCONF autoconf)
  478. if ("${AUTOCONF}" STREQUAL "AUTOCONF-NOTFOUND")
  479. message(FATAL_ERROR "Required program `autoconf` not found.")
  480. endif()
  481. set(FFmpeg_PREFIX ${PROJECT_SOURCE_DIR}/externals/ffmpeg)
  482. set(FFmpeg_BUILD_DIR ${PROJECT_BINARY_DIR}/externals/ffmpeg)
  483. set(FFmpeg_MAKEFILE ${FFmpeg_BUILD_DIR}/Makefile)
  484. make_directory(${FFmpeg_BUILD_DIR})
  485. # Read version string from external
  486. file(READ ${FFmpeg_PREFIX}/RELEASE FFmpeg_VERSION)
  487. set(FFmpeg_FOUND NO)
  488. if (NOT FFmpeg_VERSION STREQUAL "")
  489. set(FFmpeg_FOUND YES)
  490. endif()
  491. unset(FFmpeg_LIBRARIES CACHE)
  492. foreach(COMPONENT ${FFmpeg_COMPONENTS})
  493. set(FFmpeg_${COMPONENT}_PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}")
  494. set(FFmpeg_${COMPONENT}_LIB_NAME "lib${COMPONENT}.a")
  495. set(FFmpeg_${COMPONENT}_LIBRARY "${FFmpeg_${COMPONENT}_PREFIX}/${FFmpeg_${COMPONENT}_LIB_NAME}")
  496. set(FFmpeg_LIBRARIES
  497. ${FFmpeg_LIBRARIES}
  498. ${FFmpeg_${COMPONENT}_LIBRARY}
  499. CACHE PATH "Paths to FFmpeg libraries" FORCE)
  500. endforeach()
  501. Include(FindPkgConfig REQUIRED)
  502. pkg_check_modules(LIBVA libva)
  503. pkg_check_modules(CUDA cuda)
  504. pkg_check_modules(FFNVCODEC ffnvcodec)
  505. pkg_check_modules(VDPAU vdpau)
  506. set(FFmpeg_HWACCEL_LIBRARIES)
  507. set(FFmpeg_HWACCEL_FLAGS)
  508. set(FFmpeg_HWACCEL_INCLUDE_DIRS)
  509. set(FFmpeg_HWACCEL_LDFLAGS)
  510. if(LIBVA_FOUND)
  511. pkg_check_modules(LIBDRM libdrm REQUIRED)
  512. find_package(X11 REQUIRED)
  513. pkg_check_modules(LIBVA-DRM libva-drm REQUIRED)
  514. pkg_check_modules(LIBVA-X11 libva-x11 REQUIRED)
  515. list(APPEND FFmpeg_HWACCEL_LIBRARIES
  516. ${LIBDRM_LIBRARIES}
  517. ${X11_LIBRARIES}
  518. ${LIBVA-DRM_LIBRARIES}
  519. ${LIBVA-X11_LIBRARIES}
  520. ${LIBVA_LIBRARIES})
  521. set(FFmpeg_HWACCEL_FLAGS
  522. --enable-hwaccel=h264_vaapi
  523. --enable-hwaccel=vp9_vaapi
  524. --enable-libdrm)
  525. list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
  526. ${LIBDRM_INCLUDE_DIRS}
  527. ${X11_INCLUDE_DIRS}
  528. ${LIBVA-DRM_INCLUDE_DIRS}
  529. ${LIBVA-X11_INCLUDE_DIRS}
  530. ${LIBVA_INCLUDE_DIRS}
  531. )
  532. message(STATUS "VA-API found")
  533. else()
  534. set(FFmpeg_HWACCEL_FLAGS --disable-vaapi)
  535. endif()
  536. if (FFNVCODEC_FOUND AND CUDA_FOUND)
  537. list(APPEND FFmpeg_HWACCEL_FLAGS
  538. --enable-cuvid
  539. --enable-ffnvcodec
  540. --enable-nvdec
  541. --enable-hwaccel=h264_nvdec
  542. --enable-hwaccel=vp9_nvdec
  543. --extra-cflags=-I${CUDA_INCLUDE_DIRS}
  544. )
  545. list(APPEND FFmpeg_HWACCEL_LIBRARIES
  546. ${FFNVCODEC_LIBRARIES}
  547. ${CUDA_LIBRARIES}
  548. )
  549. list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS
  550. ${FFNVCODEC_INCLUDE_DIRS}
  551. ${CUDA_INCLUDE_DIRS}
  552. )
  553. list(APPEND FFmpeg_HWACCEL_LDFLAGS
  554. ${FFNVCODEC_LDFLAGS}
  555. ${CUDA_LDFLAGS}
  556. )
  557. message(STATUS "ffnvcodec libraries version ${FFNVCODEC_VERSION} found")
  558. endif()
  559. if (VDPAU_FOUND)
  560. list(APPEND FFmpeg_HWACCEL_FLAGS
  561. --enable-vdpau
  562. --enable-hwaccel=h264_vdpau
  563. --enable-hwaccel=vp9_vdpau
  564. )
  565. list(APPEND FFmpeg_HWACCEL_LIBRARIES ${VDPAU_LIBRARIES})
  566. list(APPEND FFmpeg_HWACCEL_INCLUDE_DIRS ${VDPAU_INCLUDE_DIRS})
  567. list(APPEND FFmpeg_HWACCEL_LDFLAGS ${VDPAU_LDFLAGS})
  568. message(STATUS "vdpau libraries version ${VDPAU_VERSION} found")
  569. else()
  570. list(APPEND FFmpeg_HWACCEL_FLAGS --disable-vdpau)
  571. endif()
  572. # `configure` parameters builds only exactly what yuzu needs from FFmpeg
  573. # `--disable-vdpau` is needed to avoid linking issues
  574. add_custom_command(
  575. OUTPUT
  576. ${FFmpeg_MAKEFILE}
  577. COMMAND
  578. /bin/bash ${FFmpeg_PREFIX}/configure
  579. --disable-avdevice
  580. --disable-avfilter
  581. --disable-avformat
  582. --disable-doc
  583. --disable-everything
  584. --disable-ffmpeg
  585. --disable-ffprobe
  586. --disable-network
  587. --disable-postproc
  588. --disable-swresample
  589. --enable-decoder=h264
  590. --enable-decoder=vp9
  591. --cc="${CMAKE_C_COMPILER}"
  592. --cxx="${CMAKE_CXX_COMPILER}"
  593. ${FFmpeg_HWACCEL_FLAGS}
  594. WORKING_DIRECTORY
  595. ${FFmpeg_BUILD_DIR}
  596. )
  597. unset(FFmpeg_HWACCEL_FLAGS)
  598. # Workaround for Ubuntu 18.04's older version of make not being able to call make as a child
  599. # with context of the jobserver. Also helps ninja users.
  600. execute_process(
  601. COMMAND
  602. nproc
  603. OUTPUT_VARIABLE
  604. SYSTEM_THREADS)
  605. set(FFmpeg_BUILD_LIBRARIES ${FFmpeg_LIBRARIES})
  606. add_custom_command(
  607. OUTPUT
  608. ${FFmpeg_BUILD_LIBRARIES}
  609. COMMAND
  610. make -j${SYSTEM_THREADS}
  611. WORKING_DIRECTORY
  612. ${FFmpeg_BUILD_DIR}
  613. )
  614. set(FFmpeg_INCLUDE_DIR
  615. "${FFmpeg_PREFIX};${FFmpeg_BUILD_DIR};${FFmpeg_HWACCEL_INCLUDE_DIRS}"
  616. CACHE PATH "Path to FFmpeg headers" FORCE)
  617. set(FFmpeg_LDFLAGS
  618. "${FFmpeg_HWACCEL_LDFLAGS}"
  619. CACHE STRING "FFmpeg linker flags" FORCE)
  620. # ALL makes this custom target build every time
  621. # but it won't actually build if the DEPENDS parameter is up to date
  622. add_custom_target(ffmpeg-configure ALL DEPENDS ${FFmpeg_MAKEFILE})
  623. add_custom_target(ffmpeg-build ALL DEPENDS ${FFmpeg_BUILD_LIBRARIES} ffmpeg-configure)
  624. link_libraries(${FFmpeg_LIBVA_LIBRARIES})
  625. set(FFmpeg_LIBRARIES ${FFmpeg_BUILD_LIBRARIES} ${FFmpeg_HWACCEL_LIBRARIES}
  626. CACHE PATH "Paths to FFmpeg libraries" FORCE)
  627. unset(FFmpeg_BUILD_LIBRARIES)
  628. unset(FFmpeg_HWACCEL_FLAGS)
  629. unset(FFmpeg_HWACCEL_INCLUDE_DIRS)
  630. unset(FFmpeg_HWACCEL_LDFLAGS)
  631. unset(FFmpeg_HWACCEL_LIBRARIES)
  632. if (FFmpeg_FOUND)
  633. message(STATUS "Found FFmpeg version ${FFmpeg_VERSION}")
  634. else()
  635. message(FATAL_ERROR "FFmpeg not found")
  636. endif()
  637. else() # WIN32
  638. # Use yuzu FFmpeg binaries
  639. set(FFmpeg_EXT_NAME "ffmpeg-4.4")
  640. set(FFmpeg_PATH "${CMAKE_BINARY_DIR}/externals/${FFmpeg_EXT_NAME}")
  641. download_bundled_external("ffmpeg/" ${FFmpeg_EXT_NAME} "")
  642. set(FFmpeg_FOUND YES)
  643. set(FFmpeg_INCLUDE_DIR "${FFmpeg_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE)
  644. set(FFmpeg_LIBRARY_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE)
  645. set(FFmpeg_LDFLAGS "" CACHE STRING "FFmpeg linker flags" FORCE)
  646. set(FFmpeg_DLL_DIR "${FFmpeg_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE)
  647. set(FFmpeg_LIBRARIES
  648. ${FFmpeg_LIBRARY_DIR}/swscale.lib
  649. ${FFmpeg_LIBRARY_DIR}/avcodec.lib
  650. ${FFmpeg_LIBRARY_DIR}/avutil.lib
  651. CACHE PATH "Paths to FFmpeg libraries" FORCE)
  652. endif()
  653. endif()
  654. unset(FFmpeg_COMPONENTS)
  655. # Prefer the -pthread flag on Linux.
  656. set(THREADS_PREFER_PTHREAD_FLAG ON)
  657. find_package(Threads REQUIRED)
  658. # Platform-specific library requirements
  659. # ======================================
  660. if (APPLE)
  661. # Umbrella framework for everything GUI-related
  662. find_library(COCOA_LIBRARY Cocoa)
  663. set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
  664. elseif (WIN32)
  665. # WSAPoll and SHGetKnownFolderPath (AppData/Roaming) didn't exist before WinNT 6.x (Vista)
  666. add_definitions(-D_WIN32_WINNT=0x0600 -DWINVER=0x0600)
  667. set(PLATFORM_LIBRARIES winmm ws2_32 iphlpapi)
  668. if (MINGW)
  669. # PSAPI is the Process Status API
  670. set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} psapi imm32 version)
  671. endif()
  672. elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
  673. set(PLATFORM_LIBRARIES rt)
  674. endif()
  675. # Setup a custom clang-format target (if clang-format can be found) that will run
  676. # against all the src files. This should be used before making a pull request.
  677. # =======================================================================
  678. set(CLANG_FORMAT_POSTFIX "-12")
  679. find_program(CLANG_FORMAT
  680. NAMES clang-format${CLANG_FORMAT_POSTFIX}
  681. clang-format
  682. PATHS ${PROJECT_BINARY_DIR}/externals)
  683. # if find_program doesn't find it, try to download from externals
  684. if (NOT CLANG_FORMAT)
  685. if (WIN32 AND NOT CMAKE_CROSSCOMPILING)
  686. message(STATUS "Clang format not found! Downloading...")
  687. set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
  688. file(DOWNLOAD
  689. https://github.com/yuzu-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
  690. "${CLANG_FORMAT}" SHOW_PROGRESS
  691. STATUS DOWNLOAD_SUCCESS)
  692. if (NOT DOWNLOAD_SUCCESS EQUAL 0)
  693. message(WARNING "Could not download clang format! Disabling the clang format target")
  694. file(REMOVE ${CLANG_FORMAT})
  695. unset(CLANG_FORMAT)
  696. endif()
  697. else()
  698. message(WARNING "Clang format not found! Disabling the clang format target")
  699. endif()
  700. endif()
  701. if (CLANG_FORMAT)
  702. set(SRCS ${PROJECT_SOURCE_DIR}/src)
  703. set(CCOMMENT "Running clang format against all the .h and .cpp files in src/")
  704. if (WIN32)
  705. add_custom_target(clang-format
  706. COMMAND powershell.exe -Command "Get-ChildItem '${SRCS}/*' -Include *.cpp,*.h -Recurse | Foreach {&'${CLANG_FORMAT}' -i $_.fullname}"
  707. COMMENT ${CCOMMENT})
  708. elseif(MINGW)
  709. add_custom_target(clang-format
  710. COMMAND find `cygpath -u ${SRCS}` -iname *.h -o -iname *.cpp | xargs `cygpath -u ${CLANG_FORMAT}` -i
  711. COMMENT ${CCOMMENT})
  712. else()
  713. add_custom_target(clang-format
  714. COMMAND find ${SRCS} -iname *.h -o -iname *.cpp | xargs ${CLANG_FORMAT} -i
  715. COMMENT ${CCOMMENT})
  716. endif()
  717. unset(SRCS)
  718. unset(CCOMMENT)
  719. endif()
  720. # Include source code
  721. # ===================
  722. # This function should be passed a list of all files in a target. It will automatically generate
  723. # file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
  724. # one in the filesystem.
  725. function(create_target_directory_groups target_name)
  726. # Place any files that aren't in the source list in a separate group so that they don't get in
  727. # the way.
  728. source_group("Other Files" REGULAR_EXPRESSION ".")
  729. get_target_property(target_sources "${target_name}" SOURCES)
  730. foreach(file_name IN LISTS target_sources)
  731. get_filename_component(dir_name "${file_name}" PATH)
  732. # Group names use '\' as a separator even though the entire rest of CMake uses '/'...
  733. string(REPLACE "/" "\\" group_name "${dir_name}")
  734. source_group("${group_name}" FILES "${file_name}")
  735. endforeach()
  736. endfunction()
  737. # Prevent boost from linking against libs when building
  738. add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY
  739. -DBOOST_SYSTEM_NO_LIB
  740. -DBOOST_DATE_TIME_NO_LIB
  741. -DBOOST_REGEX_NO_LIB
  742. )
  743. enable_testing()
  744. add_subdirectory(externals)
  745. add_subdirectory(src)
  746. # Set yuzu project or yuzu-cmd project as default StartUp Project in Visual Studio depending on whether QT is enabled or not
  747. if(ENABLE_QT)
  748. set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT yuzu)
  749. else()
  750. set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT yuzu-cmd)
  751. endif()
  752. # Installation instructions
  753. # =========================
  754. # Install freedesktop.org metadata files, following those specifications:
  755. # http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
  756. # http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
  757. # http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
  758. if(ENABLE_QT AND UNIX AND NOT APPLE)
  759. install(FILES "${PROJECT_SOURCE_DIR}/dist/yuzu.desktop"
  760. DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
  761. install(FILES "${PROJECT_SOURCE_DIR}/dist/yuzu.svg"
  762. DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps")
  763. install(FILES "${PROJECT_SOURCE_DIR}/dist/yuzu.xml"
  764. DESTINATION "${CMAKE_INSTALL_PREFIX}/share/mime/packages")
  765. endif()