@ -23,21 +23,21 @@ option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
option ( USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF )
if ( NOT EXISTS ${ CMAKE _SOURCE_DIR} /.git/hooks/pre-commit )
if ( NOT EXISTS ${ PROJECT _SOURCE_DIR} /.git/hooks/pre-commit )
message ( STATUS "Copying pre-commit hook" )
file ( COPY hooks/pre-commit
D E S T I N A T I O N $ { CM A K E _ S O U R C E _ D I R } / . g i t / h o o k s )
D E S T I N A T I O N $ { PR O J E C T _ S O U R C E _ D I R } / . g i t / h o o k s )
endif ( )
# S a n i t y c h e c k : C h e c k t h a t a l l s u b m o d u l e s a r e p r e s e n t
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function ( check_submodules_present )
file ( READ "${ CMAKE _SOURCE_DIR}/.gitmodules" gitmodules )
file ( READ "${ PROJECT _SOURCE_DIR}/.gitmodules" gitmodules )
string ( REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${ gitmodules } )
foreach ( module ${ gitmodules } )
string ( REGEX REPLACE "path *= *" "" module ${ module } )
if ( NOT EXISTS "${ CMAKE _SOURCE_DIR}/${module}/.git")
if ( NOT EXISTS "${ PROJECT _SOURCE_DIR}/${module}/.git")
message ( FATAL_ERROR "Git submodule ${module} not found. "
" P l e a s e r u n : g i t s u b m o d u l e u p d a t e - - i n i t - - r e c u r s i v e " )
endif ( )
@ -45,17 +45,17 @@ function(check_submodules_present)
endfunction ( )
check_submodules_present ( )
configure_file ( ${ CMAKE _SOURCE_DIR} /dist/compatibility_list/compatibility_list.qrc
$ { CM A K E _ B I N A R Y _ D I R } / d i s t / c o m p a t i b i l i t y _ l i s t / c o m p a t i b i l i t y _ l i s t . q r c
configure_file ( ${ PROJECT _SOURCE_DIR} /dist/compatibility_list/compatibility_list.qrc
$ { PR O J E C T _ B I N A R Y _ D I R } / d i s t / c o m p a t i b i l i t y _ l i s t / c o m p a t i b i l i t y _ l i s t . q r c
C O P Y O N L Y )
if ( ENABLE_COMPATIBILITY_LIST_DOWNLOAD AND NOT EXISTS ${ CMAKE _BINARY_DIR} /dist/compatibility_list/compatibility_list.json )
if ( ENABLE_COMPATIBILITY_LIST_DOWNLOAD AND NOT EXISTS ${ PROJECT _BINARY_DIR} /dist/compatibility_list/compatibility_list.json )
message ( STATUS "Downloading compatibility list for yuzu..." )
file ( DOWNLOAD
h t t p s : / / a p i . y u z u - e m u . o r g / g a m e d b /
" $ { CM A K E _ B I N A R Y _ D I R } / d i s t / c o m p a t i b i l i t y _ l i s t / c o m p a t i b i l i t y _ l i s t . j s o n " S H O W _ P R O G R E S S )
" $ { PR O J E C T _ B I N A R Y _ D I R } / d i s t / c o m p a t i b i l i t y _ l i s t / c o m p a t i b i l i t y _ l i s t . j s o n " S H O W _ P R O G R E S S )
endif ( )
if ( NOT EXISTS ${ CMAKE _BINARY_DIR} /dist/compatibility_list/compatibility_list.json )
file ( WRITE ${ CMAKE _BINARY_DIR} /dist/compatibility_list/compatibility_list.json "" )
if ( NOT EXISTS ${ PROJECT _BINARY_DIR} /dist/compatibility_list/compatibility_list.json )
file ( WRITE ${ PROJECT _BINARY_DIR} /dist/compatibility_list/compatibility_list.json "" )
endif ( )
# D e t e c t c u r r e n t c o m p i l a t i o n a r c h i t e c t u r e a n d c r e a t e s t a n d a r d d e f i n i t i o n s
@ -189,13 +189,13 @@ find_package(Boost 1.63.0 QUIET)
if ( NOT Boost_FOUND )
message ( STATUS "Boost 1.63.0 or newer not found, falling back to externals" )
set ( BOOST_ROOT "${ CMAKE _SOURCE_DIR}/externals/boost")
set ( BOOST_ROOT "${ PROJECT _SOURCE_DIR}/externals/boost")
set ( Boost_NO_SYSTEM_PATHS OFF )
find_package ( Boost QUIET REQUIRED )
endif ( )
# O u t p u t b i n a r i e s t o b i n /
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ CMAKE _BINARY_DIR} /bin )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT _BINARY_DIR} /bin )
# P r e f e r t h e - p t h r e a d f l a g o n L i n u x .
set ( THREADS_PREFER_PTHREAD_FLAG ON )
@ -264,7 +264,7 @@ if (YUZU_USE_BUNDLED_UNICORN)
endif ( )
set ( UNICORN_FOUND YES )
set ( UNICORN_PREFIX ${ CMAKE _SOURCE_DIR} /externals/unicorn )
set ( UNICORN_PREFIX ${ PROJECT _SOURCE_DIR} /externals/unicorn )
set ( LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library" FORCE )
set ( LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE )
set ( UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library" FORCE )
@ -356,12 +356,12 @@ set(CLANG_FORMAT_POSTFIX "-6.0")
find_program ( CLANG_FORMAT
N A M E S c l a n g - f o r m a t $ { C L A N G _ F O R M A T _ P O S T F I X }
c l a n g - f o r m a t
P A T H S $ { CM A K E _ B I N A R Y _ D I R } / e x t e r n a l s )
P A T H S $ { PR O J E C T _ B I N A R Y _ D I R } / e x t e r n a l s )
# i f f i n d _ p r o g r a m d o e s n ' t f i n d i t , t r y t o d o w n l o a d f r o m e x t e r n a l s
if ( NOT CLANG_FORMAT )
if ( WIN32 )
message ( STATUS "Clang format not found! Downloading..." )
set ( CLANG_FORMAT "${ CMAKE _BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
set ( CLANG_FORMAT "${ PROJECT _BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
file ( DOWNLOAD
h t t p s : / / g i t h u b . c o m / y u z u - e m u / e x t - w i n d o w s - b i n / r a w / m a s t e r / c l a n g - f o r m a t $ { C L A N G _ F O R M A T _ P O S T F I X } . e x e
" $ { C L A N G _ F O R M A T } " S H O W _ P R O G R E S S
@ -377,7 +377,7 @@ if (NOT CLANG_FORMAT)
endif ( )
if ( CLANG_FORMAT )
set ( SRCS ${ CMAKE _SOURCE_DIR} /src )
set ( SRCS ${ PROJECT _SOURCE_DIR} /src )
set ( CCOMMENT "Running clang format against all the .h and .cpp files in src/" )
if ( WIN32 )
add_custom_target ( clang-format
@ -450,10 +450,10 @@ endif()
# h t t p : / / s t a n d a r d s . f r e e d e s k t o p . o r g / i c o n - t h e m e - s p e c / i c o n - t h e m e - s p e c - l a t e s t . h t m l
# h t t p : / / s t a n d a r d s . f r e e d e s k t o p . o r g / s h a r e d - m i m e - i n f o - s p e c / s h a r e d - m i m e - i n f o - s p e c - l a t e s t . h t m l
if ( ENABLE_QT AND UNIX AND NOT APPLE )
install ( FILES "${ CMAKE _SOURCE_DIR}/dist/yuzu.desktop"
install ( FILES "${ PROJECT _SOURCE_DIR}/dist/yuzu.desktop"
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e / a p p l i c a t i o n s " )
install ( FILES "${ CMAKE _SOURCE_DIR}/dist/yuzu.svg"
install ( FILES "${ PROJECT _SOURCE_DIR}/dist/yuzu.svg"
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e / i c o n s / h i c o l o r / s c a l a b l e / a p p s " )
install ( FILES "${ CMAKE _SOURCE_DIR}/dist/yuzu.xml"
install ( FILES "${ PROJECT _SOURCE_DIR}/dist/yuzu.xml"
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ P R E F I X } / s h a r e / m i m e / p a c k a g e s " )
endif ( )