Bug#862328: Ping

Kim Gräsman kim.grasman at gmail.com
Sat Nov 11 21:22:31 UTC 2017


Hello,

I've been banging my head against this for a while, too.

>From what I can tell, Sylvain's original report is correct, there's no
way to use the Clang CMake modules in this packaging.

CMake can be convinced to find Clang with:

    find_package(Clang REQUIRED CONFIG NAMES llvm Clang)

but even then it will fail with

     CMake Error at /usr/share/llvm-3.9/cmake/ClangConfig.cmake:16 (include):
      include could not find load file:

        /usr/lib/cmake/clang/ClangTargets.cmake
    Call Stack (most recent call first):
      CMakeLists.txt:34 (find_package)

The failing module, ClangConfig.cmake, does:

    ...
    set(CLANG_CMAKE_DIR "${CLANG_INSTALL_PREFIX}/lib/cmake/clang")

    # Provide all our library targets to users.
    include("${CLANG_CMAKE_DIR}/ClangTargets.cmake")
    ...

This can never match ClangTargets.cmake's true location, which is just
next to ClangConfig.cmake, in /usr/share/llvm-3.9/cmake.

I haven't had a chance to investigate Sylvain's patch, or understand
what the root cause of the problem is (Clang or packaging), but I'll
try to dig deeper.

Cheers,
- Kim



More information about the Pkg-llvm-team mailing list