From 2bc8bf7ecb4eb83c05d76485fdce0d3aa9f8ccdd Mon Sep 17 00:00:00 2001 From: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Wed, 23 Dec 2020 23:42:22 +0100 Subject: [PATCH] Deploy Qt DLLs (#1115) --- src/hyperiond/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hyperiond/CMakeLists.txt b/src/hyperiond/CMakeLists.txt index 2ec4cf75..02bce862 100644 --- a/src/hyperiond/CMakeLists.txt +++ b/src/hyperiond/CMakeLists.txt @@ -136,7 +136,17 @@ if(CMAKE_HOST_UNIX) install( CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_hyperiond )" COMPONENT "Hyperion" ) endif() -# Copy dependencies (not for OSX) +# Deploy Qt DLLs into the binary folder. +# This is necessary for starting the application from within the IDE +if(WIN32) + get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) + get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY) + find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}") + set(WINDEPLOYQT_PARAMS --verbose 0 --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler) + add_custom_command(TARGET hyperiond POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} ${WINDEPLOYQT_PARAMS} "$") +endif() + +# Deploy all dependencies for package creation (not for OSX) include(${CMAKE_SOURCE_DIR}/cmake/Dependencies.cmake) if (NOT ENABLE_OSX AND NOT WIN32) # Unix