Unable to Build Qt Documentation on Windows 11 – Missing LLVM/Clang CMake Config Files
-
I am currently trying to build the Qt documentation on a Windows 11 (64-bit) system. I have already built the Qt 6 source code successfully, and I can run the source build inside Qt Creator using the MinGW toolchain. However, documentation generation does not support MinGW, so I installed Visual Studio Build Tools 2022 with the full C++ development workload.
The remaining blocker is obtaining a correct LLVM/Clang installation that includes the CMake configuration files required by qdoc. I have attempted multiple official LLVM Windows installers across different versions, but each installation seems to be missing the necessary Clang CMake config file.
Qt qdoc requires the following files:
C:\Program Files\LLVM\lib\cmake\llvm\LLVMConfig.cmake
C:\Program Files\LLVM\lib\cmake\clang\ClangConfig.cmakeIn my case, LLVMConfig.cmake exists, but ClangConfig.cmake is always missing. From what I understand, this usually means the installer did not include:
- Clang libraries
- Clang tools
- libclang development files (CMake configs)
This seems to happen with some official LLVM Windows installers, which ship LLVM core without the Clang development package.
When running CMake for the Qt build with documentation enabled, I use the following command:
cmake -G Ninja ^
-DQT_BUILD_DOCS=ON ^
-DQT_QDOC_ENABLE_CLANG=ON ^
-DLLVM_DIR="C:/Program Files/LLVM/lib/cmake/llvm" ^
-DClang_DIR="C:/Program Files/LLVM/lib/cmake/clang" ^
D:\QtBuild\source\qt6All other prerequisites have been installed correctly. The only blocking issue is obtaining an LLVM/Clang Windows distribution that provides the required CMake configuration files for qdoc.
Can anyone recommend a specific LLVM/Clang Windows build or installer that includes both LLVMConfig.cmake and ClangConfig.cmake, or point me to the correct distribution needed for building Qt documentation on Windows?
Thank you.
-
I am currently trying to build the Qt documentation on a Windows 11 (64-bit) system. I have already built the Qt 6 source code successfully, and I can run the source build inside Qt Creator using the MinGW toolchain. However, documentation generation does not support MinGW, so I installed Visual Studio Build Tools 2022 with the full C++ development workload.
The remaining blocker is obtaining a correct LLVM/Clang installation that includes the CMake configuration files required by qdoc. I have attempted multiple official LLVM Windows installers across different versions, but each installation seems to be missing the necessary Clang CMake config file.
Qt qdoc requires the following files:
C:\Program Files\LLVM\lib\cmake\llvm\LLVMConfig.cmake
C:\Program Files\LLVM\lib\cmake\clang\ClangConfig.cmakeIn my case, LLVMConfig.cmake exists, but ClangConfig.cmake is always missing. From what I understand, this usually means the installer did not include:
- Clang libraries
- Clang tools
- libclang development files (CMake configs)
This seems to happen with some official LLVM Windows installers, which ship LLVM core without the Clang development package.
When running CMake for the Qt build with documentation enabled, I use the following command:
cmake -G Ninja ^
-DQT_BUILD_DOCS=ON ^
-DQT_QDOC_ENABLE_CLANG=ON ^
-DLLVM_DIR="C:/Program Files/LLVM/lib/cmake/llvm" ^
-DClang_DIR="C:/Program Files/LLVM/lib/cmake/clang" ^
D:\QtBuild\source\qt6All other prerequisites have been installed correctly. The only blocking issue is obtaining an LLVM/Clang Windows distribution that provides the required CMake configuration files for qdoc.
Can anyone recommend a specific LLVM/Clang Windows build or installer that includes both LLVMConfig.cmake and ClangConfig.cmake, or point me to the correct distribution needed for building Qt documentation on Windows?
Thank you.
@Hruthik-T-M I've reported this to LLVM that they should ship the CMake files needed to consume the libraries, and they closed it as won't do.
You can use Qt's LLVM prebuilt libraries at https://download.qt.io/development_releases/prebuilt/libclang/qt/
You get also the MinGW build of LLVM.