Installing Clang for QDoc
QDoc uses Clang when parsing C++ files as well as function signatures in \fn commands. Clang is part of the LLVM Compiler Infrastructure Project. Therefore, if you are going to build QDoc from source, you need to install LLVM 8.0 or greater first.
You can get LLVM/Clang through various channels.
For Debian-based Linux distributions, it is sufficient to install the libclang-dev
package and its dependencies. For running QDoc, the libclang
package is required.
You can also find pre-built binaries for most platforms here.
If you install LLVM in a custom location you need to tell CMake where to find it. This can be done by adding the installation path to the CMAKE_PREFIX_PATH
CMake cache variable.
Note: On Windows, after installing the pre-built LLVM you must restart your build shell to ensure that LLVM's binary directory is added to the PATH variable. This is needed to be able to run qdoc.