[llvm-bugs] [Bug 37128] New: ClangConfig.cmake is unusable

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 13 12:21:20 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37128

            Bug ID: 37128
           Summary: ClangConfig.cmake is unusable
           Product: Packaging
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: deb packages
          Assignee: unassignedbugs at nondot.org
          Reporter: zsolt.parragi at cancellar.hu
                CC: llvm-bugs at lists.llvm.org

The ClangConfig.cmake file is installed to an incorrect location, which makes
it unusable from CMake.

For 6.0, it is installed in /usr/share/llvm-6.0/cmake/

However, when trying to discover clang using the following CMake command:

FIND_PACKAGE(Clang REQUIRED PATHS "/usr/share/llvm-6.0/cmake/" NO_DEFAULT_PATH)

cmake fails, as the config script assumes a fixed directory structure, and some
of the required files are located in a different directory, under /usr/lib/llvm

This can be fixed by symlinking/copying/moving  /usr/share/llvm-6.0/cmake/
directory to /usr/lib/llvm-6.0/lib/cmake/clang.

Even after this, CMake still fails because it can't find some executables.

 * First it can't find the clang executable, because it expects to find it
under /usr/lib/llvm-6.0/bin/clang-6.0, so another symlink has to be created
there
 * then it also tries to find the clang-format, clang-tidy and
clang-import-test executables. These are at the correct locations, but only
installed as part of the clang-tidy-6.0, clang-format-6.0, and clang-tools-6.0
packages. Without installing those packages, the cmake finder can't be used.
This part probably isn't a bug, but it isn't mentioned anywhere.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180413/093e1f0d/attachment.html>


More information about the llvm-bugs mailing list