Failing to CMake standalone clang-interpreter

Hello List,

I'm trying to build clang-interpreter as a standalone project using CMake but am getting lots of undefined references in the linking stage. Platform is Linux, using latest llvm & clang off SVN built into /usr/local prefix using CMake.

I basically copied a slightly stripped down version of llvm/tools/clang/CMakeLists.txt into my project's root dir. [0]

The project root dir's CMakeLists.txt includes subdirectory ./src in which clang-interpreter.cpp is (which was taken from llvm/tools/clang/examples/clang-interpreter/). Also one can find src/CMakeLists.txt, which is essentially a copy of llvm/tools/clang/examples/clang-interpreter/CMakeLists.txt, but with more LLVM_LINK_COMPONENTS added [1].

Running:

   mkdir build -p && \
     cd build && \
     cmake .. -DCLANG_PATH_TO_LLVM_BUILD=/usr/local && \
     make

... results in lots of undefined references in the linking stage [2].

Does anyone know what I'm doing wrong here? Would very much appreciate any pointers.

Many thanks,

Miguel

[0] test-prj/CMakeLists.txt: http://paste.ubuntu.com/1317323/
[1] test-prj/src/CMakeLists.txt: http://paste.ubuntu.com/1317332/
[2] Build output: http://paste.ubuntu.com/1317337/