Public bug reported:

Description:    Ubuntu 16.04.2 LTS
Release:        16.04

clang-4.0:
  Installed: 1:4.0~svn303688-1~exp1
  Candidate: 1:4.0~svn304242-1~exp1
  Version table:
     1:4.0~svn304242-1~exp1 500
        500 http://apt.llvm.org/xenial llvm-toolchain-xenial-4.0/main amd64 
Packages
 *** 1:4.0~svn303688-1~exp1 100
        100 /var/lib/dpkg/status

First, I want to note that my clang-4.0 is from llvm's package and not
this package that I'm linked to, but in my (limited) understanding I
feel like this error is going to occur both ways. Please correct me if
I'm wrong.

ClangConfig.cmake is installed in
`/usr/share/llvm-4.0/cmake/ClangConfig.cmake` which is not by default
searched by cmake and needs to be remedied by adding a PATHS option to
the typical find_package command (i.e. `find_package(Clang REQUIRED
CONFIG PATHS "/usr/share/llvm-4.0/cmake/")`). The /usr directory isn't
listed in any of the list of directories searched here
https://cmake.org/cmake/help/v3.8/command/find_package.html, so this
choice seems a little odd to me.

Having remedied this by adding the option another error occurs with the
final line of ClangConfig.cmake where it attempts to
`include(${CLANG_CMAKE_DIR}/ClangTargets.cmake")`. This fails because
earlier CLANG_MAKE_DIR is set through `set(CLANG_CMAKE_DIR
"${CLANG_INSTALL_PREFIX}/lib/cmake/clang")` where CLANG_INSTALL_PREFIX
has been resolved earlier to be `/usr`. The file
`/usr/lib/cmake/clang/ClangMakeTargets.cmake` actually exists at
`/usr/share/llvm-4.0/cmake/ClangTargets.cmake`.

My first guess is that it was built in one directory and moved here
since the file seems to be a templated file like this https://github.com
/llvm-mirror/clang/blob/master/cmake/modules/ClangConfig.cmake.in that
gets built by this file https://github.com/llvm-
mirror/clang/blob/master/cmake/modules/CMakeLists.txt#L22.

** Affects: llvm-toolchain-4.0 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: clang cmake

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1694845

Title:
  ClangConfig.cmake in bad directory

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-4.0/+bug/1694845/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to