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

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
 * 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.
llvm-bugs mailing list

Reply via email to