Install and load icons from Icons in executable directory, fixes local builds using Icons

This commit is contained in:
Zion Nimchuk 2018-01-26 20:51:56 -08:00 committed by Ivan
parent 9d079ede85
commit 70fe0cc224
2 changed files with 13 additions and 0 deletions

View File

@ -457,6 +457,13 @@ endif()
cotire(rpcs3)
if (UNIX)
# Copy icons to executable directory
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/bin/Icons $<TARGET_FILE_DIR:rpcs3>/Icons)
endif()
# Unix installation
if(UNIX AND NOT APPLE)
# Install the binary

View File

@ -472,6 +472,7 @@ namespace rsx
//Resource was not found in config dir, try and grab from relative path (linux)
info = std::make_unique<image_info>(("Icons/ui/" + res).c_str());
#ifndef _WIN32
// Check for Icons in ../share/rpcs3 for AppImages and /usr/bin/
if (info->data == nullptr)
{
char result[ PATH_MAX ];
@ -483,6 +484,11 @@ namespace rsx
std::string executablePath = dirname(result);
info = std::make_unique<image_info>((executablePath + "/../share/rpcs3/Icons/ui/" + res).c_str());
// Check if the icons are in the same directory as the executable (local builds)
if (info->data == nullptr)
{
info = std::make_unique<image_info>((executablePath + "/Icons/ui/" + res).c_str());
}
}
#endif
if (info->data != nullptr)