Skip to content

Commit f5dd6e3

Browse files
committed
Build - fix Windows windeployqt path when QT_INSTALL_PREFIX is empty
1 parent 2509259 commit f5dd6e3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

app/gui/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,16 @@ if(WIN32)
543543
${API_VENDORED_KISSFFT_DLL}
544544
$<TARGET_FILE_DIR:${APP_NAME}>)
545545

546-
# Run winddeployqt if it can be found, to ensure installed dependencies
546+
# Locate windeployqt: prefer the Qt we configured against (QT_INSTALL_PREFIX),
547+
# else fall back to PATH — same resolution as macdeployqt above.
548+
if(QT_INSTALL_PREFIX AND EXISTS "${QT_INSTALL_PREFIX}/bin/windeployqt.exe")
549+
set(WINDEPLOYQT_BIN "${QT_INSTALL_PREFIX}/bin/windeployqt")
550+
else()
551+
set(WINDEPLOYQT_BIN "windeployqt")
552+
endif()
553+
message(STATUS "windeployqt: ${WINDEPLOYQT_BIN}")
547554
add_custom_command(TARGET ${APP_NAME} POST_BUILD
548-
COMMAND ${QT_INSTALL_PREFIX}/bin/windeployqt $<TARGET_FILE:${APP_NAME}>)
555+
COMMAND ${WINDEPLOYQT_BIN} $<TARGET_FILE:${APP_NAME}>)
549556
endif() # Win32
550557

551558
# Make convenient source groups in the IDE

0 commit comments

Comments
 (0)