Skip to content

Commit 4a620d9

Browse files
committed
s
1 parent 2afc9dc commit 4a620d9

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/CI-windows.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ jobs:
6161
- name: Deploy GUI
6262
run: |
6363
windeployqt build\bin\Debug || exit /b !errorlevel!
64-
del build\bin\Debug\cppcheck-gui.ilk || exit /b !errorlevel!
65-
del build\bin\Debug\cppcheck-gui.pdb || exit /b !errorlevel!
6664
6765
# TODO: run GUI tests
6866

@@ -71,3 +69,4 @@ jobs:
7169
rem TODO: the Qt DLLs are not being installed
7270
cmake --build build --config Debug --target install
7371
rem TODO: validate the installed files
72+
rem TODO: the structure does not match an actual Windows installation

cmake/findDependencies.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ if(BUILD_GUI)
2626
find_program(QHELPGENERATOR qhelpgenerator HINTS ${_qt_bin_dir} REQUIRED)
2727
endif()
2828
endif()
29+
30+
if(MSVC)
31+
find_program(WINDEPLOYQT windeployqt)
32+
if(NOT WINDEPLOYQT)
33+
# TODO: how to properly get the Qt binary folder?
34+
# piggy-back off Qt::qmake for now as it should be in the same folder as the binary we are looking for
35+
get_target_property(_qmake_executable Qt::qmake IMPORTED_LOCATION)
36+
get_filename_component(_qt_bin_dir ${_qmake_executable} DIRECTORY)
37+
message(STATUS "windeployqt not found in PATH - trying ${_qt_bin_dir}")
38+
find_program(WINDEPLOYQT windeployqt HINTS ${_qt_bin_dir} REQUIRED)
39+
endif()
40+
endif()
2941
endif()
3042

3143
if(HAVE_RULES)

gui/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ CheckOptions:
7171
add_dependencies(cppcheck-gui online-help.qhc)
7272
endif()
7373

74+
if(MSVC)
75+
message(STATUS "CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}")
76+
add_custom_target(windeployqt ${WINDEPLOYQT} ${CMAKE_BINARY_DIR})
77+
add_dependencies(windeployqt cppcheck-gui)
78+
endif()
79+
7480
install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications)
7581
install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications)
7682

0 commit comments

Comments
 (0)