Skip to content

Commit 986be8d

Browse files
Update CMakeLists.txt
1 parent 50b48d1 commit 986be8d

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

src/CMakeLists.txt

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,30 +238,19 @@ if (WIN32)
238238
"${Qt5_DIR}/../../../qml/Qt/labs/settings" "${CMAKE_BINARY_DIR}/deploy/Qt/labs/settings")
239239

240240
# Ensure Qt Quick Controls 1/Dialogs are always staged. The Dialogs module
241-
# depends on QtQuick.Controls 1.2 and its backing DLL, but windeployqt can
242-
# miss them. Copy them explicitly so the NSIS script can bundle them and
243-
# fail loudly if they are missing so we never ship an installer without the
244-
# required FileDialog backend.
245-
set(QT_QUICKCONTROLS_DLL "${Qt5_DIR}/../../../bin/Qt5QuickControls.dll")
246-
set(QT_QUICKCONTROLS_DLL_PRESENT OFF)
247-
if(EXISTS "${QT_QUICKCONTROLS_DLL}")
248-
set(QT_QUICKCONTROLS_DLL_PRESENT ON)
249-
add_custom_command(TARGET ${PROJECT_NAME}
250-
POST_BUILD
251-
COMMAND ${CMAKE_COMMAND} -E copy_if_different
252-
"${QT_QUICKCONTROLS_DLL}" "${CMAKE_BINARY_DIR}/deploy")
253-
else()
254-
message(FATAL_ERROR "Qt Quick Controls 1 library not found at ${QT_QUICKCONTROLS_DLL}; install the Qt Quick Controls component to bundle FileDialog dependencies")
255-
endif()
256-
241+
# depends on QtQuick.Controls 1.2, but windeployqt can miss it. Copy the
242+
# QML modules explicitly so the NSIS script can bundle them and fail loudly
243+
# if they are missing so we never ship an installer without the required
244+
# FileDialog backend.
257245
set(QT_QUICKCONTROLS_QML_DIR "${Qt5_DIR}/../../../qml/QtQuick/Controls")
258-
if(IS_DIRECTORY "${QT_QUICKCONTROLS_QML_DIR}")
246+
set(QT_QUICKCONTROLS_PLUGIN "${QT_QUICKCONTROLS_QML_DIR}/qtquickcontrolsplugin.dll")
247+
if(IS_DIRECTORY "${QT_QUICKCONTROLS_QML_DIR}" AND EXISTS "${QT_QUICKCONTROLS_PLUGIN}")
259248
add_custom_command(TARGET ${PROJECT_NAME}
260249
POST_BUILD
261250
COMMAND ${CMAKE_COMMAND} -E copy_directory
262251
"${QT_QUICKCONTROLS_QML_DIR}" "${CMAKE_BINARY_DIR}/deploy/QtQuick/Controls")
263252
else()
264-
message(FATAL_ERROR "Qt Quick Controls 1 QML directory not found at ${QT_QUICKCONTROLS_QML_DIR}; install the Qt Quick Controls component to bundle FileDialog dependencies")
253+
message(FATAL_ERROR "Qt Quick Controls 1 QML directory not found at ${QT_QUICKCONTROLS_QML_DIR} or missing qtquickcontrolsplugin.dll; install the Qt Quick Controls component to bundle FileDialog dependencies")
265254
endif()
266255

267256
set(QT_QUICKDIALOGS_QML_DIR "${Qt5_DIR}/../../../qml/QtQuick/Dialogs")

0 commit comments

Comments
 (0)