Skip to content

Commit

Permalink
Use FindQtDocs module to locate tag files
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 27641be
Author: Paul Colby <[email protected]>
Date:   Wed Jan 24 22:32:15 2024 +1100

    Remove unnecessary check

    `QtDocs_FOUND` must be true, because we specify `REQUIRED` in the
    `find_package()` call.

commit a0b0655
Author: Paul Colby <[email protected]>
Date:   Wed Jan 24 21:55:10 2024 +1100

    Treat Qt 5.10 and 5.11 differently

    They only have a single `qt` doc archive.

commit 2363d48
Author: Paul Colby <[email protected]>
Date:   Wed Jan 24 21:38:27 2024 +1100

    Use modern aqt version

commit 35d3307
Author: Paul Colby <[email protected]>
Date:   Wed Jan 24 20:44:25 2024 +1100

    Specify the correct QT_INSTALL_DOCS value

    Note, this is because `aqt install-doc` does not update the config
    used by `qmake` and/or `qtpaths` (which are installed via separate
    `aqt` comamnds).

commit 75b6f77
Author: Paul Colby <[email protected]>
Date:   Wed Jan 24 20:19:54 2024 +1100

    Install docs for the CodeQL build too

commit caeaa31
Author: Paul Colby <[email protected]>
Date:   Tue Jan 23 22:38:52 2024 +1100

    Distinguish archives and moduels for Qt docs

commit c6ff58b
Author: Paul Colby <[email protected]>
Date:   Tue Jan 23 22:29:47 2024 +1100

    Also install docs for the sonar workflow

commit 3941c28
Author: Paul Colby <[email protected]>
Date:   Tue Jan 23 22:25:36 2024 +1100

    Specifiy modules to install docs for

commit 830e70d
Author: Paul Colby <[email protected]>
Date:   Tue Jan 23 22:15:56 2024 +1100

    Install Qt docs

commit 1e4e2bb
Author: Paul Colby <[email protected]>
Date:   Tue Jan 23 21:40:20 2024 +1100

    Enable debug logging for now

commit 09c3999
Author: Paul Colby <[email protected]>
Date:   Mon Jan 22 22:24:49 2024 +1100

    Switch to using my FindQtDocs cmake module

commit 2a1473d
Author: Paul Colby <[email protected]>
Date:   Sat Jan 20 10:53:46 2024 +1100

    Detect the QT_INSTALL_DOCS path via qtpaths or qmake
  • Loading branch information
pcolby committed Jan 24, 2024
1 parent 8c47dbe commit 1aa0e3e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov libfuse2 qtbase5-dev qtconnectivity5-dev qttools5-dev qttools5-dev-tools
sudo apt install lcov libfuse2 qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Install linuxdeploy
run: |
curl --create-dirs --location --output-dir /home/runner/.local/bin --remote-name-all \
Expand Down Expand Up @@ -107,6 +107,10 @@ jobs:
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
documentation: true
doc-archives: ${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' || (startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: ==3.1.* # \todo https://github.com/jurplel/install-qt-action/issues/218
- name: Install linuxdeploy
run: |
curl --create-dirs --location --output-dir /home/runner/.local/bin --remote-name-all \
Expand All @@ -121,7 +125,10 @@ jobs:
CXX: ${{ matrix.env.cxx }}
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}${{ matrix.env.coverage && '-cov' || '' }}.qt-${{ matrix.qt }}
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake -D CMAKE_BUILD_TYPE=Release \
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
Expand Down Expand Up @@ -201,6 +208,10 @@ jobs:
with:
version: ${{ matrix.qt }}
modules: ${{ startsWith(matrix.qt, '6') && 'qtconnectivity' || '' }}
documentation: true
doc-archives: ${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' || (startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: ==3.1.* # \todo https://github.com/jurplel/install-qt-action/issues/218
- name: Build
id: build
env:
Expand All @@ -212,6 +223,7 @@ jobs:
cmake -D CMAKE_BUILD_TYPE=Release \
-D CODECOV_GCOV=${{ startsWith(matrix.env.cc, 'gcc') && '/usr/local/bin/gcov-12' || '/usr/bin/gcov'}} \
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-D QT_INSTALL_DOCS="$RUNNER_WORKSPACE/Qt/Docs/Qt-${{ matrix.qt }}" \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -327,6 +339,7 @@ jobs:
version: ${{ matrix.qt }}
arch: win64_msvc2019_64
set-env: false
aqtversion: ==3.1.* # \todo https://github.com/jurplel/install-qt-action/issues/218
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -337,6 +350,10 @@ jobs:
# \todo Remove this if/when the runner's MinGW is updated to fix the incompatibility.
tools: ${{ startsWith(matrix.qt, '6.6') && startsWith(matrix.generator, 'MinGW') && 'tools_mingw90' || '' }}
#add-tools-to-path: true ///< \toto Use once released by install-qt-action.
documentation: true
doc-archives: ${{ (startsWith(matrix.qt, '5.10.') || startsWith(matrix.qt, '5.11.')) && 'qt' || (startsWith(matrix.qt, '5') && 'qtcore qtbluetooth' || 'qtcore') }}
doc-modules: ${{ startsWith(matrix.qt, '6') && 'qtbluetooth' || '' }}
aqtversion: ==3.1.* # \todo https://github.com/jurplel/install-qt-action/issues/218
- name: Configure cross-compilation
if: matrix.arch == 'arm64'
shell: bash
Expand All @@ -354,7 +371,10 @@ jobs:
run: |
# \todo Remove this when either the runner's MinGW is upgraded, or add-tools-to-path is released by install-qt-action.
if exist "%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64" set "PATH=%GITHUB_WORKSPACE%\..\Qt\Tools\mingw1120_64\bin\;%PATH%"
cmake -D CMAKE_BUILD_TYPE=Release -D QT_HOST_PATH=%qtHostPath% -G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%"
cmake -D CMAKE_BUILD_TYPE=Release ^
-D QT_HOST_PATH=%qtHostPath% ^
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%"
cmake --build "%RUNNER_TEMP%"
- name: Capture build-output variables
id: post-build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
"$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" --version
- name: Build docs
run: |
cmake -D "DOXYGEN_EXECUTABLE=$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" -D "QT_TAGFILES_PATH=/usr/share/qt5/doc" -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake -D "DOXYGEN_EXECUTABLE=$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
cmake --build "$RUNNER_TEMP" --target doc doc-internal
- name: Upload public docs
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install lcov qtbase5-dev qtconnectivity5-dev qttools5-dev qttools5-dev-tools
sudo apt install lcov qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Run build-wrapper
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
sudo apt-mark hold grub-efi-amd64-signed
sudo apt update
sudo apt upgrade
sudo apt install qtbase5-dev qtconnectivity5-dev qttools5-dev qttools5-dev-tools
sudo apt install qtbase5-dev qtbase5-doc-dev qtconnectivity5-dev qtconnectivity5-doc-html qttools5-dev qttools5-dev-tools
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
20 changes: 12 additions & 8 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <[email protected]>
# SPDX-License-Identifier: LGPL-3.0-or-later

# Include Qt doc tagfiles, if provided.
if (QT_TAGFILES_PATH)
set(QT_DOCS_BASEURL "https://doc.qt.io/qt-${QT_VERSION_MAJOR}/")
message(STATUS "Using Qt doc tagfiles ${QT_TAGFILES_PATH} (${QT_DOCS_BASEURL})")
set(DOX_TAGFILES "\\
\"${QT_TAGFILES_PATH}/qtcore/qtcore.tags=${QT_DOCS_BASEURL}\" \\
\"${QT_TAGFILES_PATH}/qtbluetooth/qtbluetooth.tags=${QT_DOCS_BASEURL}\" \\")
endif()
include(FetchContent)
FetchContent_Declare(FindQtDocs GIT_REPOSITORY "https://github.com/pcolby/cmake-modules" GIT_TAG "v1")
FetchContent_MakeAvailable(FindQtDocs)
list(PREPEND CMAKE_MODULE_PATH "${findqtdocs_SOURCE_DIR}")
find_package(QtDocs REQUIRED COMPONENTS Core Bluetooth)

# Include Qt doc tagfiles, if available.
set(QT_DOCS_BASEURL "https://doc.qt.io/qt-${QT_VERSION_MAJOR}/")
message(STATUS "Using Qt doc tagfiles ${QT_INSTALL_DOCS} => ${QT_DOCS_BASEURL}")
set(DOX_TAGFILES "\\
\"${QtDocs_Core_TAGS}=${QT_DOCS_BASEURL}\" \\
\"${QtDocs_Bluetooth_TAGS}=${QT_DOCS_BASEURL}\" \\")

find_package(Doxygen)
if (DOXYGEN_FOUND)
Expand Down

0 comments on commit 1aa0e3e

Please sign in to comment.