Allow relocation of resource files

--- cmake/BuildParameters.cmake.orig	2023-02-10 03:43:10 UTC
+++ cmake/BuildParameters.cmake
@@ -260,6 +260,10 @@
 	list(APPEND PCSX2_DEFS DISABLE_BUILD_DATE)
 endif()
 
+if(DEFINED PCSX2_RESOURCES_PATH)
+    add_compile_definitions(PCSX2_RESOURCES_PATH="${PCSX2_RESOURCES_PATH}")
+endif()
+
 #-------------------------------------------------------------------------------
 # MacOS-specific things
 #-------------------------------------------------------------------------------
--- pcsx2/Pcsx2Config.cpp.orig	2023-08-31 07:45:23 UTC
+++ pcsx2/Pcsx2Config.cpp
@@ -1676,6 +1676,10 @@ void EmuFolders::SetAppRoot()
 
 void EmuFolders::SetResourcesDirectory()
 {
+#ifdef PCSX2_RESOURCES_PATH
+	// Resources' path specified at compile time
+	EmuFolders::Resources = Path::Canonicalize(PCSX2_RESOURCES_PATH);
+#else
 #ifndef __APPLE__
 	// On Windows/Linux, these are in the binary directory.
 	Resources = Path::Combine(AppRoot, "resources");
@@ -1683,6 +1687,7 @@ void EmuFolders::SetResourcesDirectory()
 	// On macOS, this is in the bundle resources directory.
 	Resources = Path::Canonicalize(Path::Combine(AppRoot, "../Resources"));
 #endif
+#endif // PCSX2_RESOURCES_PATH
 }
 
 bool EmuFolders::ShouldUsePortableMode()
