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/Frontend/CommonHost.cpp.orig	2023-02-10 03:43:10 UTC
+++ pcsx2/Frontend/CommonHost.cpp
@@ -128,6 +128,10 @@
 
 void CommonHost::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.
 	EmuFolders::Resources = Path::Combine(EmuFolders::AppRoot, "resources");
@@ -135,6 +139,7 @@
 	// On macOS, this is in the bundle resources directory.
 	EmuFolders::Resources = Path::Canonicalize(Path::Combine(EmuFolders::AppRoot, "../Resources"));
 #endif
+#endif // PCSX2_RESOURCES_PATH
 }
 
 bool CommonHost::ShouldUsePortableMode()
