CMake: Fix package mode

This commit is contained in:
Connor McLaughlin 2021-12-10 22:29:43 +10:00 committed by refractionpcsx2
parent 0e0e23eefb
commit 3073281d13
3 changed files with 6 additions and 11 deletions

View File

@ -58,10 +58,7 @@ endif()
# Install some files to ease package creation
if(PACKAGE_MODE)
if(NOT DISABLE_CHEATS_ZIP)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2")
endif()
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/GameIndex.yaml" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2")
INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/bin/resources" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2")
# set categories depending on system/distribution in pcsx2.desktop
if(openSUSE)

View File

@ -43,7 +43,6 @@ option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option
# Path and lib option
#-------------------------------------------------------------------------------
option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)")
option(DISABLE_CHEATS_ZIP "Disable including the cheats_ws.zip file")
option(DISABLE_PCSX2_WRAPPER "Disable including the PCSX2-linux.sh file")
option(DISABLE_SETCAP "Do not set files capabilities")
option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
@ -59,7 +58,7 @@ endif()
if(PACKAGE_MODE)
# Compile all source codes with those defines
list(APPEND PCSX2_DEFS
GAMEINDEX_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DATADIR}/PCSX2
PCSX2_APP_DATADIR="${CMAKE_INSTALL_FULL_DATADIR}/PCSX2"
DOC_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DOCDIR})
endif()

View File

@ -185,14 +185,12 @@ namespace PathDefs
{
#ifdef __APPLE__
return wxDirName(wxStandardPaths::Get().GetResourcesDir());
#elif !defined(GAMEINDEX_DIR_COMPILATION)
#elif !defined(PCSX2_APP_DATADIR)
return AppRoot();
#else
// Each linux distributions have his rules for path so we give them the possibility to
// change it with compilation flags. -- Gregory
#define xGAMEINDEX_str(s) GAMEINDEX_DIR_str(s)
#define GAMEINDEX_DIR_str(s) #s
return wxDirName(xGAMEINDEX_str(GAMEINDEX_DIR_COMPILATION));
return wxDirName(PCSX2_APP_DATADIR);
#endif
}
@ -253,10 +251,11 @@ namespace PathDefs
wxDirName GetResources()
{
// ifdef is only needed here because mac doesn't put its resources in a subdirectory..
#ifdef __APPLE__
return wxDirName(wxStandardPaths::Get().GetResourcesDir());
#else
return AppRoot() + Base::Resources();
return GetProgramDataDir() + Base::Resources();
#endif
}