From 4b9fa8ec6d1126e4812fb767d80647e26776b688 Mon Sep 17 00:00:00 2001 From: Henrique Jung Date: Sun, 10 Sep 2017 02:15:49 -0300 Subject: [PATCH] CMake build: copy QT DLLs files to bin directory AppVeyor build relies on CMake to build the VS project files, which then is used to build RPCS3, so we must tell CMake to copy Qt DLLs files the same way VS build does. --- rpcs3/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 171f8f1b99..fd85939eb1 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -397,6 +397,31 @@ target_link_libraries(rpcs3 ${RPCS3_QT_LIBS}) set_target_properties(rpcs3 PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${RPCS3_SRC_DIR}/stdafx.h") +if (MSVC) + # Under Windows, some QT DLLs need to be in the same directory of the compiled + # RPCS3 binary, so copy them from the local QT installation at the end of the + # build + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + # debug build uses different DDLs files + set (RUNTIME_DLLS + $ENV{QTDIR}/bin/Qt5Cored.dll + $ENV{QTDIR}/bin/Qt5Guid.dll + $ENV{QTDIR}/bin/Qt5Widgetsd.dll + $ENV{QTDIR}/bin/Qt5WinExtrasd.dll + ) + else() + set (RUNTIME_DLLS + $ENV{QTDIR}/bin/Qt5Core.dll + $ENV{QTDIR}/bin/Qt5Gui.dll + $ENV{QTDIR}/bin/Qt5Widgets.dll + $ENV{QTDIR}/bin/Qt5WinExtras.dll + ) + endif() + add_custom_command(TARGET rpcs3 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${RUNTIME_DLLS} ${CMAKE_BINARY_DIR}/bin + ) +endif() + cotire(rpcs3) # Unix installation