<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVMConfig.cmake and ClangConfig.cmake not available in installation path"
   href="https://bugs.llvm.org/show_bug.cgi?id=46597">46597</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVMConfig.cmake and ClangConfig.cmake not available in installation path
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>cmake
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>th0ma7@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am new to playing with llvm/clang.  Basically I'm building llvm/clang and
installing it into a specific path.

In order to do an out-of-tree build of other subsequent tools (opencl-clang,
etc) I need to specify the directory where LLVMConfig.cmake and
ClangConfig.cmake resides.  It appear in my case that they only reside in the
build directory but are not installed over into my installation path.  Also
note that otherwise the build & install is indeed successful.

I'm building with the following arguments:
-DCMAKE_BUILD_TYPE=release
-DCMAKE_INSTALL_PREFIX=$(WORK_DIR)/install/$(INSTALL_PREFIX)
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_C_COMPILER=$(TC_PATH)$(TC_PREFIX)gcc
-DCMAKE_CXX_COMPILER=$(TC_PATH)$(TC_PREFIX)g++
-DCMAKE_CXX_FLAGS=-std=c++11
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_ENABLE_PROJECTS=clang
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON
-DLLVM_INSTALL_UTILS=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=ON

Optionnally I tried playing with the following two options with no success:
-DCLANG_CMAKE_DIR=$(WORK_DIR)/install/$(INSTALL_PREFIX)/lib/cmake/clang
-DLLVM_CMAKE_DIR=$(WORK_DIR)/install/$(INSTALL_PREFIX)/lib/cmake/llvm

Files available post-build & install:
$ find . -name "LLVMConfig.cmake"
./work-native/llvm-project-llvmorg-10.0.0/build/lib/cmake/llvm/LLVMConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/cmake/modules/CMakeFiles/LLVMConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/NATIVE/lib/cmake/llvm/LLVMConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/NATIVE/cmake/modules/CMakeFiles/LLVMConfig.cmake

$ find . -name "ClangConfig.cmake"
./work-native/llvm-project-llvmorg-10.0.0/build/tools/clang/cmake/modules/CMakeFiles/ClangConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/lib/cmake/clang/ClangConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/NATIVE/tools/clang/cmake/modules/CMakeFiles/ClangConfig.cmake
./work-native/llvm-project-llvmorg-10.0.0/build/NATIVE/lib/cmake/clang/ClangConfig.cmake</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>