summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2026-09-17 01:22:55 +0200
committerGitHub <noreply@github.com>2026-09-17 01:22:55 +0200
commita96b5da8562c387acb2f43a4133c45c8bdcecd1e (patch)
treef48c91fd7e76c6fba308213b54ad415b6c54c345 /Source/Core
parent9611279be550ee262f30b7b0d11f92a0d5fc08f5 (diff)
parente9c5b57d88a339f3a94df8eb96bda9023be663d6 (diff)
Merge pull request #14832 from JoshuaVandaele/windeployqt-fix
DolphinQt: Properly define QtPaths
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/CMakeLists.txt38
-rw-r--r--Source/Core/DolphinQt/qtpaths.bat.in2
-rw-r--r--Source/Core/DolphinQt/target_qt.conf.in24
3 files changed, 59 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index 1228885c1d..599bc541db 100644
--- a/Source/Core/DolphinQt/CMakeLists.txt
+++ b/Source/Core/DolphinQt/CMakeLists.txt
@@ -1,9 +1,22 @@
-if (MSVC)
+if (WIN32)
+ set(DOLPHIN_QT_X64_ROOT "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/x64")
+ set(DOLPHIN_QT_ARM64_ROOT "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/ARM64")
+
if(_M_ARM_64)
- list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/ARM64")
+ set(DOLPHIN_QT_ROOT "${DOLPHIN_QT_ARM64_ROOT}")
+ set(DOLPHIN_QT_TARGET_SPEC "win32-arm64-msvc")
else()
- list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/Externals/Qt/Qt6.8.3/x64")
+ set(DOLPHIN_QT_ROOT "${DOLPHIN_QT_X64_ROOT}")
+ set(DOLPHIN_QT_TARGET_SPEC "win32-msvc")
endif()
+
+ if(DOLPHIN_HOST STREQUAL "ARM64")
+ set(DOLPHIN_QT_HOST_ROOT "${DOLPHIN_QT_ARM64_ROOT}")
+ else()
+ set(DOLPHIN_QT_HOST_ROOT "${DOLPHIN_QT_X64_ROOT}")
+ endif()
+
+ list(APPEND CMAKE_PREFIX_PATH "${DOLPHIN_QT_ROOT}")
endif()
set(CMAKE_AUTOMOC ON)
@@ -557,7 +570,21 @@ if (WIN32)
# Delegate to Qt's official deployment binary on Windows to copy over the necessary Qt-specific libraries, etc.
get_target_property(MOC_EXECUTABLE_LOCATION Qt6::moc IMPORTED_LOCATION)
get_filename_component(QT_BINARY_DIRECTORY "${MOC_EXECUTABLE_LOCATION}" DIRECTORY)
- find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BINARY_DIRECTORY}")
+ find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BINARY_DIRECTORY}" REQUIRED)
+ find_program(QTPATHS_EXE NAMES qtpaths6 qtpaths HINTS "${QT_BINARY_DIRECTORY}" REQUIRED)
+
+ # We don't use target_qt.conf/qtpaths.bat from a Qt build because they use absolute paths.
+ configure_file(
+ "target_qt.conf.in"
+ "${CMAKE_BINARY_DIR}/target_qt.conf"
+ @ONLY
+ )
+ configure_file(
+ "qtpaths.bat.in"
+ "${CMAKE_BINARY_DIR}/qtpaths.bat"
+ @ONLY
+ )
+ set(QTPATHS_SHIM "${CMAKE_BINARY_DIR}/qtpaths.bat")
# Note: We set the PATH for the duration of this command so that the
# deployment application is able to locate the Qt libraries to copy.
@@ -575,7 +602,8 @@ if (WIN32)
#
add_custom_command(TARGET dolphin-emu POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E env PATH="${QT_BINARY_DIRECTORY}"
- "${WINDEPLOYQT_EXE}" --libdir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ "${WINDEPLOYQT_EXE}" --qtpaths="${QTPATHS_SHIM}"
+ --libdir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
--plugindir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/QtPlugins"
$<IF:$<CONFIG:Debug>,--debug,--release>
--no-translations
diff --git a/Source/Core/DolphinQt/qtpaths.bat.in b/Source/Core/DolphinQt/qtpaths.bat.in
new file mode 100644
index 0000000000..6f5ffd1895
--- /dev/null
+++ b/Source/Core/DolphinQt/qtpaths.bat.in
@@ -0,0 +1,2 @@
+@echo off
+"@QTPATHS_EXE@" -qtconf "%~dp0target_qt.conf" %*
diff --git a/Source/Core/DolphinQt/target_qt.conf.in b/Source/Core/DolphinQt/target_qt.conf.in
new file mode 100644
index 0000000000..9ea042101f
--- /dev/null
+++ b/Source/Core/DolphinQt/target_qt.conf.in
@@ -0,0 +1,24 @@
+[Paths]
+Prefix=@DOLPHIN_QT_ROOT@
+Documentation=doc
+Headers=include
+Libraries=lib
+LibraryExecutables=bin
+Binaries=bin
+Plugins=plugins
+QmlImports=qml
+ArchData=.
+Data=.
+Translations=translations
+Examples=examples
+Tests=tests
+Settings=etc/xdg
+HostPrefix=@DOLPHIN_QT_HOST_ROOT@
+HostBinaries=bin
+HostLibraries=lib
+HostLibraryExecutables=bin
+HostData=@DOLPHIN_QT_HOST_ROOT@
+Sysroot=
+SysrootifyPrefix=false
+TargetSpec=@DOLPHIN_QT_TARGET_SPEC@
+HostSpec=