@sierdzio said in QDoc produces empty directory:
qdoc is considered to be an internal tool of Qt, it is only intended to generate Qt documentation.
As this was thread was just brought to my attention, I'll respond here despite the thread being quite old: this statement is incorrect. QDoc is used for a range of projects outside of Qt and has been used by several commercial customers for a long time. As per an announcement at KDE Akademy yesterday, KDE's API documentation is now generated by QDoc.
@Mark81 said in QDoc produces empty directory:
I'm not sure how to include paths.
You must pass the correct include paths when invoking QDoc. Under the hood, QDoc interfaces with Clang, and if Clang doesn't know the existence of types, you get errors. They cascade. The easiest way to do this is integrate QDoc with your build system, unfortunately, Qt doesn't provide a user facing CMake API for this (yet, anyway, there's an open task for it on bugreports). You can find an example of how you can have CMake generate and pass the correct include paths if you look at https://code.qt.io/cgit/qt/qttools.git/tree/src/qdoc/qdoc/tests/validateqdocoutputfiles/CMakeLists.txt#n25:
On line 25; set an output path for the file. Lines 30-39: Extract Qt include paths and framework paths.
Line 41 gets the target's include directories (here, for the test), and line 42 generates a file called qdocincludepaths.inc.
Then pass that file (through its output path) to the qdoc invocation as an "at-file"; e.g. qdoc -outputdir /some/path @/path/to/qdocincludepaths.inc mydocconfig.qdocconf
The include path requirement exists because QDoc needs to understand your actual code structure to generate meaningful documentation. The CMake approach handles this automatically, and that's why we use this in our CI tests.