[LLVMdev] CMake sample project?

Cyrille Berger cberger at cberger.net
Mon Jun 14 02:14:53 PDT 2010


On Monday 14 June 2010, Nathan Jeffords wrote:
> I built the list by hand though trial and error. I'm not sure if and how
> llvm-config works with cmake. Its seems now that I got the
> right dependencies in the right order, there have been no
> ongoing maintenance issues.

I use llvm-config with cmake, for this I wrote a FindLLVM.cmake file [1], it 
provides a FIND_LLVM_LIBS macro that calls llvm-config, example of use in [2]. 
Unfortunately it does not work with MSVC, so I had to hardcode the libraries 
when building with MSVC.

The LLVM_NATIVE_OBJECTS part of FIND_LLVM_LIBS is probably not needed anymore, 
since everything seems to be shipped as static library nowdays.

[1] http://bitbucket.org/opengtl/opengtl/src/tip/cmake/modules/FindLLVM.cmake
[2] 
http://bitbucket.org/opengtl/opengtl/src/tip/OpenGTL/GTLCore/CMakeLists.txt

-- 
Cyrille Berger



More information about the llvm-dev mailing list