mirror of
https://github.com/RetroPie/EmulationStation.git
synced 2025-04-02 10:41:48 -04:00
Compare commits
3 commits
c95f3162df
...
1d75274cdb
Author | SHA1 | Date | |
---|---|---|---|
|
1d75274cdb | ||
|
c930587250 | ||
|
d083efb4ab |
3 changed files with 29 additions and 2 deletions
|
@ -23,6 +23,11 @@ endif()
|
||||||
|
|
||||||
project(emulationstation-all)
|
project(emulationstation-all)
|
||||||
|
|
||||||
|
|
||||||
|
# program name to be used as a reference when looking up resources
|
||||||
|
set(AppDataName "EmulationStation" CACHE STRING "Internal program name passed to compiler")
|
||||||
|
add_definitions(-DAPPDATANAME="${AppDataName}")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
#add local find scripts to CMAKE path
|
#add local find scripts to CMAKE path
|
||||||
LIST(APPEND CMAKE_MODULE_PATH
|
LIST(APPEND CMAKE_MODULE_PATH
|
||||||
|
@ -277,6 +282,9 @@ set(dir ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
||||||
set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
||||||
|
|
||||||
|
# install rules for resources
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
install(DIRECTORY resources DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${AppDataName}/resources")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# add each component
|
# add each component
|
||||||
|
|
|
@ -144,10 +144,11 @@ endif()
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# set up CPack install stuff so `make install` does something useful
|
# set up CPack install stuff so `make install` does something useful
|
||||||
|
include(GNUInstallDirs)
|
||||||
install(TARGETS emulationstation
|
install(TARGETS emulationstation
|
||||||
RUNTIME
|
RUNTIME
|
||||||
DESTINATION bin)
|
DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
|
||||||
|
|
||||||
INCLUDE(InstallRequiredSystemLibraries)
|
INCLUDE(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
#include "utils/FileSystemUtil.h"
|
#include "utils/FileSystemUtil.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
#ifndef APPDATANAME
|
||||||
|
#define APPDATANAME "EmulationStation"
|
||||||
|
#endif
|
||||||
|
|
||||||
auto array_deleter = [](unsigned char* p) { delete[] p; };
|
auto array_deleter = [](unsigned char* p) { delete[] p; };
|
||||||
auto nop_deleter = [](unsigned char* /*p*/) { };
|
auto nop_deleter = [](unsigned char* /*p*/) { };
|
||||||
|
|
||||||
|
@ -27,6 +31,20 @@ std::string ResourceManager::getResourcePath(const std::string& path) const
|
||||||
{
|
{
|
||||||
std::string test;
|
std::string test;
|
||||||
|
|
||||||
|
// check in standard AppData locations
|
||||||
|
#if defined(__linux__)
|
||||||
|
test = Utils::FileSystem::getHomePath() + "/.local/share/" + APPDATANAME + "/resources/" + &path[2];
|
||||||
|
if (Utils::FileSystem::exists(test))
|
||||||
|
return test;
|
||||||
|
|
||||||
|
test = std::string("/usr/local/share/") + APPDATANAME + "/resources/" + &path[2];
|
||||||
|
if (Utils::FileSystem::exists(test))
|
||||||
|
return test;
|
||||||
|
|
||||||
|
test = std::string("/usr/share/") + APPDATANAME + "/resources/" + &path[2];
|
||||||
|
if (Utils::FileSystem::exists(test))
|
||||||
|
return test;
|
||||||
|
#endif
|
||||||
// check in homepath
|
// check in homepath
|
||||||
test = Utils::FileSystem::getHomePath() + "/.emulationstation/resources/" + &path[2];
|
test = Utils::FileSystem::getHomePath() + "/.emulationstation/resources/" + &path[2];
|
||||||
if(Utils::FileSystem::exists(test))
|
if(Utils::FileSystem::exists(test))
|
||||||
|
|
Loading…
Add table
Reference in a new issue