I've mentioned it in bug #425844 but as it is closed I post a new one. When I try to use LLVM in cmake by: find_package(LLVM) it fails: CMake Error at /usr/share/llvm/cmake/LLVMConfig.cmake:155 (include): include could not find load file: LLVM-Config Call Stack (most recent call first): CMakeLists.txt:6 (find_package) Setting the CMAKE_MODULE_PATH to /usr/share/llvm/cmake/ does not seems to help (I might do something wrong as this is my first project with cmake) but changing: if( NOT LLVMCONFIG_INCLUDED ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/var/tmp/portage-ondisk/portage/sys-devel/llvm-3.3-r2/work/llvm-3.3.src/cmake/modules") to if( NOT LLVMCONFIG_INCLUDED ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/share/llvm/cmake/") in /usr/share/llvm/cmake/LLVMConfig.cmake works (/var/tmp/portage-ondisk/ is $PORTAGE_TMPDIR)
Well, it's my first attempt at enabling cmake support with autoconf build, so it may not work :). If you could find a fix to the llvm build that doesn't involve playing with files directly, that would be great.
Created attachment 366546 [details, diff] Patch (In reply to Michał Górny from comment #1) > Well, it's my first attempt at enabling cmake support with autoconf build, > so it may not work :). Don't worry. Just in case it wasn't clear - it's me who get something for free. > If you could find a fix to the llvm build that > doesn't involve playing with files directly, that would be great. I'm running the build now with this patch but something like that should work.
Hm, I don't understand what's happening here. I would expect that if it sees LLVMConfig.cmake, it should see other modules from that directory as well...
Created attachment 366818 [details, diff] Patch Working patch attached (works from /etc/patches)
Wouldn't this cause cmake to load some modules from /usr/share/llvm/cmake instead of build-dir when doing the build?
(In reply to Michał Górny from comment #5) > Wouldn't this cause cmake to load some modules from /usr/share/llvm/cmake > instead of build-dir when doing the build? I don't think so although I might be wrong: - I assume adding at the end of path makes it the lowest priority - Since this is already done by cmake llvm modules I would think such possibility is already taken care by llvm (to start with include(LLVM-Config) might access system installed llvm) - It would also occur if dev have 2 llvm builds and one is in path. Given that it is recommended setup (for devel/release builds) I find it unlikely that it would cause problems.
Committed as -r3. Though I'd appreciate if you could play with it a little and find out what we are doing wrong exactly as I don't want to carry hacks indefinitely. You may take a look at existing software that uses LLVM/cmake.
Cleaning some old llvm bugs, find_package(LLVM) works fine now :) (tested with a sample CMakeLists.txt from http://llvm.org/docs/CMake.html#embedding)