@@ -108,66 +108,58 @@ source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/help-src"
108108 FILES ${QTFRED_HELP_SOURCES} )
109109
110110add_custom_command (TARGET qtfred_help POST_BUILD
111- COMMAND ${ CMAKE_COMMAND } -E make_directory "$< TARGET_FILE_DIR : qtfred >/help"
111+
112112 COMMAND ${CMAKE_COMMAND } -E copy_if_different
113113 "${QTFRED_HELP_QCH} "
114- "$<TARGET_FILE_DIR :qtfred >/help/ qtfred_help.qch"
114+ "$<TARGET_FILE_DIR :qtfred >/qtfred_help.qch"
115115 VERBATIM )
116116
117117install (FILES "${QTFRED_HELP_QCH} "
118- DESTINATION ${BINARY_DESTINATION} /help
118+ DESTINATION ${BINARY_DESTINATION}
119119 COMPONENT "qtFRED" )
120120# --- end QtFRED built-in help ---
121121
122122enable_clang_tidy (qtfred )
123123COPY_FILES_TO_TARGET (qtfred )
124124if (WIN32 )
125- # Retrieve the absolute path to qmake and then use that path to find
126- # the windeployqt executable
127- get_target_property (QMAKE_EXE Qt6::qmake IMPORTED_LOCATION )
128- get_filename_component (QT_BIN_DIR ${QMAKE_EXE} DIRECTORY )
129-
130- find_program (WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR} " )
131- find_program (WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR} " )
132-
133- # Run windeployqt immediately after build
134- add_custom_command (TARGET qtfred
135- POST_BUILD
136- COMMAND Qt6::windeployqt --dir "${CMAKE_CURRENT_BINARY_DIR } /windeployqt" "$<TARGET_FILE_DIR :qtfred >/$<TARGET_FILE_NAME :qtfred >"
137- )
138- install (
139- DIRECTORY
140- "${CMAKE_CURRENT_BINARY_DIR } /windeployqt/"
141- DESTINATION ${BINARY_DESTINATION}
142- COMPONENT "qtFRED"
143- )
144-
145- # Windows requires that the qwindows DLL is copied as well
146- execute_process (COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE QT_INSTALL_PLUGINS OUTPUT_STRIP_TRAILING_WHITESPACE )
147- set (qwindows_path "${QT_INSTALL_PLUGINS} /platforms/qwindows$<$<OR :$<CONFIG :Debug >,$<CONFIG :FastDebug >>:d >.dll" )
148-
149- add_custom_command (TARGET qtfred
150- POST_BUILD
151- COMMAND ${CMAKE_COMMAND } -E copy_if_different "${qwindows_path} " "$<TARGET_FILE_DIR :qtfred >/platforms/qwindows$<$<OR :$<CONFIG :Debug >,$<CONFIG :FastDebug >>:d >.dll"
152- VERBATIM )
153-
154- install (FILES ${qwindows_path}
155- DESTINATION ${BINARY_DESTINATION} /platforms
156- COMPONENT "qtFRED"
157- )
158-
159- # Qt Help requires the SQLite SQL driver
160- set (qsqlite_path "${QT_INSTALL_PLUGINS} /sqldrivers/qsqlite$<$<OR :$<CONFIG :Debug >,$<CONFIG :FastDebug >>:d >.dll" )
161-
162- add_custom_command (TARGET qtfred
163- POST_BUILD
164- COMMAND ${CMAKE_COMMAND } -E copy_if_different "${qsqlite_path} " "$<TARGET_FILE_DIR :qtfred >/sqldrivers/qsqlite$<$<OR :$<CONFIG :Debug >,$<CONFIG :FastDebug >>:d >.dll"
165- VERBATIM )
125+ get_target_property (QMAKE_EXE Qt6::qmake IMPORTED_LOCATION )
126+ get_filename_component (QT_BIN_DIR ${_QTFRED_QMAKE} DIRECTORY )
127+ message (STATUS "Qt bin dir: ${QT_BIN_DIR} " )
128+ message (STATUS "qmake path: ${QMAKE_EXE} " )
129+ find_program (WINDEPLOYQT_EXECUTABLE
130+ NAMES windeployqt6 windeployqt
131+ HINTS "${QT_BIN_DIR} "
132+ REQUIRED
133+ )
134+ if (NOT WINDEPLOYQT_EXECUTABLE)
135+ message (WARNING "windeployqt not found in '${QT_BIN_DIR} ' — Qt DLLs will not be deployed" )
136+ else ()
137+ message (STATUS "Found windeployqt: ${WINDEPLOYQT_EXECUTABLE} " )
138+ endif ()
139+ add_custom_command (TARGET qtfred POST_BUILD
140+ COMMAND ${CMAKE_COMMAND } -E echo "Target file is: $<TARGET_FILE :qtfred >"
141+ COMMENT "Debug: checking target file path"
142+ )
143+ add_custom_command (TARGET qtfred POST_BUILD
144+ COMMAND "${WINDEPLOYQT_EXECUTABLE} "
145+ --qthelp
146+ $<$<OR :$<CONFIG :Debug >,$<CONFIG :FastDebug >>:--debug >
147+ $<$<CONFIG :Release >:--release >
148+ --dir "$<TARGET_FILE_DIR :qtfred >"
149+ $<TARGET_FILE :qtfred >
150+ COMMENT "Running windeployqt (with Qt Help support)..."
151+ )
166152
167- install (FILES ${qsqlite_path}
168- DESTINATION ${BINARY_DESTINATION} /sqldrivers
153+ install (
154+ DIRECTORY "$<TARGET_FILE_DIR :qtfred >/"
155+ DESTINATION ${BINARY_DESTINATION}
169156 COMPONENT "qtFRED"
170- )
157+ FILES_MATCHING
158+ PATTERN "Qt6Help*.dll"
159+ PATTERN "qsqlite*.dll"
160+ PATTERN "qwindows*.dll"
161+ PATTERN "*.dll"
162+ )
171163elseif (FSO_BUILD_APPIMAGE)
172164 configure_file ("${CMAKE_CURRENT_SOURCE_DIR } /cmake/AppRun.in" "${CMAKE_CURRENT_BINARY_DIR } /AppRun.gen" @ONLY )
173165 file (GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR } /AppRun-$<CONFIG >"
0 commit comments