diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 21d54052ef2..d19710a4dc5 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -58,6 +58,7 @@ jobs: - name: Install missing software (gui) on latest ubuntu if: matrix.build_gui run: | + # TODO: add qt6-documentation-tools for qhelpgenerator - currently fails with "qhelpgenerator: could not find a Qt installation of ''" - see https://askubuntu.com/a/1460243 apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev # needs to be called after the package installation since diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 5649d3362f0..b6586bad54f 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -51,9 +51,11 @@ jobs: if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' run: | sudo apt-get update + sudo apt-get install libxml2-utils libtinyxml2-dev # qt6-tools-dev-tools for lprodump # qt6-l10n-tools for lupdate - sudo apt-get install libxml2-utils libtinyxml2-dev qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + # TODO: add qt6-documentation-tools for qhelpgenerator - currently fails with "qhelpgenerator: could not find a Qt installation of ''" - see https://askubuntu.com/a/1460243 + sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev # coreutils contains "nproc" - name: Install missing software on macos @@ -127,9 +129,11 @@ jobs: if: contains(matrix.os, 'ubuntu') && matrix.use_qt6 == 'On' run: | sudo apt-get update + sudo apt-get install libxml2-utils # qt6-tools-dev-tools for lprodump # qt6-l10n-tools for lupdate - sudo apt-get install libxml2-utils qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev + # TODO: add qt6-documentation-tools for qhelpgenerator - currently fails with "qhelpgenerator: could not find a Qt installation of ''" - see https://askubuntu.com/a/1460243 + sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev # coreutils contains "nproc" - name: Install missing software on macos @@ -515,6 +519,7 @@ jobs: sudo apt-get update # qt6-tools-dev-tools for lprodump # qt6-l10n-tools for lupdate + # TODO: add qt6-documentation-tools for qhelpgenerator - currently fails with "qhelpgenerator: could not find a Qt installation of ''" - see https://askubuntu.com/a/1460243 sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libglx-dev libgl1-mesa-dev sudo apt-get install libboost-container-dev diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index bdfc171d7e9..2cbf3d106c9 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -28,6 +28,17 @@ if(BUILD_GUI) find_package(Qt5 COMPONENTS ${qt_components} REQUIRED) set(QT_VERSION "${Qt5Core_VERSION_STRING}") endif() + + find_program(QHELPGENERATOR qhelpgenerator) + if(NOT QHELPGENERATOR) + # TODO: how to properly get the Qt binary folder? + # piggy-back off Qt::qmake for now as it should be in the same folder as the binary we are looking for + get_target_property(_qmake_executable Qt::qmake IMPORTED_LOCATION) + get_filename_component(_qt_bin_dir ${_qmake_executable} DIRECTORY) + message(STATUS "qhelpgenerator not found in PATH - trying ${_qt_bin_dir}") + # cannot be mandatory since qhelpgenerator is missing from the official qttools Linux package - https://bugreports.qt.io/browse/QTBUG-116168 + find_program(QHELPGENERATOR qhelpgenerator HINTS ${_qt_bin_dir}) + 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..2f86d568331 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -71,6 +71,12 @@ CheckOptions: target_compile_options_safe(cppcheck-gui -Wno-redundant-parens) endif() + if (QHELPGENERATOR) + # 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) + endif() + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)