From 3073281d13c34b1d089ef71acaf0f4380e3e92df Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 10 Dec 2021 22:29:43 +1000 Subject: [PATCH] CMake: Fix package mode --- CMakeLists.txt | 5 +---- cmake/BuildParameters.cmake | 3 +-- pcsx2/gui/AppConfig.cpp | 9 ++++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37ec70818f..36124fc1b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index b4b81b1347..3a2ed63f6b 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -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() diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 60f3165093..f3ffa9ac47 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -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 }