Skip to content

Commit 1cb4c99

Browse files
committed
Make QtDoc linkage optional
But issue a notice if not being used, and require it in most cases in CI.
1 parent d7cfead commit 1cb4c99

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ jobs:
129129
[[ '${{ matrix.os }}' == '22.04' && '${{ matrix.cc }}' == 'clang' ]] ||
130130
"$RUNNER_TEMP/coverage/src/cli/dokit" --version
131131
"$RUNNER_TEMP/release/src/cli/dokit" --version
132+
- name: Verify tagfiles were configured # except when using Ubuntu 22.04's Qt6 packages.
133+
if: matrix.qt != '6' || matrix.os != '22.04'
134+
run: |
135+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/public.doxy"
136+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/internal.doxy"
132137
- name: Test w/ coverage
133138
if: matrix.os != '22.04' || matrix.cc != 'clang'
134139
run: ctest --output-on-failure --test-dir "$RUNNER_TEMP/coverage" --verbose
@@ -352,6 +357,10 @@ jobs:
352357
"$RUNNER_TEMP/release/src/cli/dokit.app/Contents/MacOS/dokit" --version
353358
[[ '${{ matrix.os }}' == 'macos-13' && '${{ matrix.cc }}' == 'clang' ]] ||
354359
"$RUNNER_TEMP/coverage/src/cli/dokit.app/Contents/MacOS/dokit" --version
360+
- name: Verify tagfiles were configured
361+
run: |
362+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/public.doxy"
363+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/internal.doxy"
355364
- name: Grant Bluetooth access # Only needed for unit tests with older Qt's on newer runners.
356365
if: matrix.os != 'macos-13' && ( startsWith(matrix.qt, '5') || startsWith(matrix.qt, '6.2.') )
357366
run: >
@@ -664,6 +673,8 @@ jobs:
664673
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
665674
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/coverage"
666675
cmake --build "%RUNNER_TEMP%/coverage" --verbose
676+
grep -Ee 'qt(core|bluetooth)\.tags' "%RUNNER_TEMP%/coverage/doc/public.doxy"
677+
grep -Ee 'qt(core|bluetooth)\.tags' "%RUNNER_TEMP%/coverage/doc/internal.doxy"
667678
- name: Build w/o coverage instrumentation
668679
env:
669680
CMAKE_MESSAGE_LOG_LEVEL: VERBOSE
@@ -675,6 +686,8 @@ jobs:
675686
-D QT_INSTALL_DOCS=%RUNNER_WORKSPACE%\Qt\Docs\Qt-${{ matrix.qt }} ^
676687
-G "${{ matrix.generator }}" -S "%GITHUB_WORKSPACE%" -B "%RUNNER_TEMP%/release"
677688
cmake --build "%RUNNER_TEMP%/release" --verbose
689+
grep -Ee 'qt(core|bluetooth)\.tags' "%RUNNER_TEMP%/release/doc/public.doxy"
690+
grep -Ee 'qt(core|bluetooth)\.tags' "%RUNNER_TEMP%/release/doc/internal.doxy"
678691
- name: Capture build-output variables
679692
id: post-build
680693
shell: bash

.github/workflows/docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
run: |
3232
cmake -D "DOXYGEN_EXECUTABLE=$RUNNER_TEMP/doxygen-${DOXYGEN_VERSION}/bin/doxygen" \
3333
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
34+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/public.doxy"
35+
grep -Ee 'qt(core|bluetooth)\.tags' "$RUNNER_TEMP/release/doc/internal.doxy"
3436
cmake --build "$RUNNER_TEMP" --target doc doc-internal
3537
- name: Upload public docs
3638
uses: actions/upload-artifact@v4

doc/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ include(FetchContent)
55
FetchContent_Declare(FindQtDocs GIT_REPOSITORY "https://github.com/pcolby/cmake-modules" GIT_TAG "v1")
66
FetchContent_MakeAvailable(FindQtDocs)
77
list(PREPEND CMAKE_MODULE_PATH "${findqtdocs_SOURCE_DIR}")
8-
find_package(QtDocs REQUIRED COMPONENTS Core Bluetooth)
8+
find_package(QtDocs COMPONENTS Core Bluetooth)
99

1010
# Include Qt doc tagfiles, if available.
11-
set(QT_DOCS_BASEURL "https://doc.qt.io/qt-${QT_VERSION_MAJOR}/")
12-
message(STATUS "Using Qt doc tagfiles ${QT_INSTALL_DOCS} => ${QT_DOCS_BASEURL}")
13-
set(DOX_TAGFILES "\\
14-
\"${QtDocs_Core_TAGS}=${QT_DOCS_BASEURL}\" \\
15-
\"${QtDocs_Bluetooth_TAGS}=${QT_DOCS_BASEURL}\" \\")
11+
if (QtDocs_FOUND)
12+
set(QT_DOCS_BASEURL "https://doc.qt.io/qt-${QT_VERSION_MAJOR}/")
13+
message(STATUS "Using Qt doc tagfiles ${QT_INSTALL_DOCS} => ${QT_DOCS_BASEURL}")
14+
set(DOX_TAGFILES "\\
15+
\"${QtDocs_Core_TAGS}=${QT_DOCS_BASEURL}\" \\
16+
\"${QtDocs_Bluetooth_TAGS}=${QT_DOCS_BASEURL}\" \\")
17+
else()
18+
message(NOTICE "QtDocs not found. Project docs will be built without external links to Qt documentation.")
19+
endif()
1620

1721
find_package(Doxygen)
1822
if (DOXYGEN_FOUND)

0 commit comments

Comments
 (0)