diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index bdfc171d7e9..1115a2260fe 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -28,6 +28,21 @@ if(BUILD_GUI) find_package(Qt5 COMPONENTS ${qt_components} REQUIRED) set(QT_VERSION "${Qt5Core_VERSION_STRING}") endif() + + if(WIN32) + # TODO: how to properly get the Qt binary folder? + if(WINDEPLOYQT_EXECUTABLE) + # piggy-back off WINDEPLOYQT_EXECUTABLE for now as it is in the same folder as the binary we are looking for + get_filename_component(_qt_bin_dir ${WINDEPLOYQT_EXECUTABLE} DIRECTORY) + else() + # WINDEPLOYQT_EXECUTABLE does not seem to exist with Qt5 so piggy-back off another variable + get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) + get_filename_component(_qt_bin_dir ${_qmake_executable} DIRECTORY) + endif() + find_program(QHELPGENERATOR qhelpgenerator HINTS ${_qt_bin_dir} REQUIRED) + else() + find_program(QHELPGENERATOR qhelpgenerator REQUIRED) + endif() endif() if(HAVE_RULES) diff --git a/cmake/printInfo.cmake b/cmake/printInfo.cmake index bb633650b7d..97681645035 100644 --- a/cmake/printInfo.cmake +++ b/cmake/printInfo.cmake @@ -73,6 +73,7 @@ if(BUILD_GUI) message(STATUS "Qt5Core_LIBRARIES = ${Qt5Core_LIBRARIES}") message(STATUS "Qt5Core_INCLUDE_DIRS = ${Qt5Core_INCLUDE_DIRS}") endif() + message(STATUS "QHELPGENERATOR = ${QHELPGENERATOR}") endif() message(STATUS) message(STATUS "HAVE_RULES = ${HAVE_RULES}") diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 31fe62eaf64..cd73ab96ecb 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -71,6 +71,10 @@ CheckOptions: target_compile_options_safe(cppcheck-gui -Wno-redundant-parens) endif() + # TODO: generate in CMAKE_BINARY_DIR folder + add_custom_target(online-help.qhc ${QHELPGENERATOR} ${CMAKE_CURRENT_SOURCE_DIR}/help/online-help.qhcp -o ${CMAKE_CURRENT_SOURCE_DIR}/help/online-help.qhc) + add_dependencies(cppcheck-gui online-help.qhc) + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)