Building on LLVM on OSX: invalid install?

Dear all,

I am trying to move a project from Linux to OSX, with bad results at my first attempt. First, I am using LLVM 3.2, the latest version, compiled from sources (configured with just the install prefix, vanilla for other options).

By the way, I found it annoying to reinstall LLVM, I expected a complete and working LLVM environment with Apple's move to CLANG, but maybe I didn't try that hard.

Anyway, this is my lines on CMakeLists.txt, working on linux like a charm:

########### LLVM ##########
SET (LLVM_ROOT "" CACHE PATH "Root of LLVM install.")
IF (NOT EXISTS ${LLVM_ROOT}/include/llvm)
     MESSAGE (FATAL_ERROR "LLVM_ROOT (${LLVM_ROOT}) is not a valid LLVM install")
ENDIF ()
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_ROOT}/share/llvm/cmake")
INCLUDE (LLVMConfig)
LLVM_MAP_COMPONENTS_TO_LIBRARIES (REQ_LLVM_LIBRARIES jit native)

I the same error trying to build a JNI bridge to LLVM on OS X. Interesting to know that it's an OS X problem. Sorry I don't have an answer for you.

Sensei <senseiwa@gmail.com> writes:

[snip]

It turns out, no file matching LLVMConfig is found on OSX, in my
installation at least, and even making share/llvm and copying "cmake"
from the initial tarball doesn't work.

% ls share/llvm/cmake
README config-ix.cmake* modules/ platforms/

Can anyone point me in the right direction?

Seems that the CMake files are missing because LLVM was built with
configure&make. Try building and installing LLVM with cmake and
everything should work.

Copying the cmake files from a tarball doesn't work because some of them
are generated by the build process.