LibClang error when used as submodule
Created by: minexew
On Fedora 26, CMake fails with the following output: (note: i'm using libclangmm as a submodule -- not that it should make any difference)
Searcing for libclang
CMake Error at libclangmm/src/CMakeLists.txt:12 (find_package):
By not providing "FindLibClang.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "LibClang",
but CMake did not find one.
Could not find a package configuration file provided by "LibClang" with any
of the following names:
LibClangConfig.cmake
libclang-config.cmake
Add the installation prefix of "LibClang" to CMAKE_PREFIX_PATH or set
"LibClang_DIR" to a directory containing one of the above files. If
"LibClang" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "clang-experiments/CMakeFiles/CMakeOutput.log".
Curiously enough, Fedora provides ClangConfig.cmake (without the Lib
). After modifying libclangmm's CMakeFiles to find_package(Clang)
, the build is successful, though I assume that breaks it for other distros.
For some reason, ClangConfig.cmake also pulls in static libLLVM as a dependency (130 MB!), although this isn't required if I link against libclang manually. Is there a way to bypass the find_package
altogether and specify libclang include/lib paths manually? (preferably without modifying libclangmm's CMakeLists)