[LLVMdev] CMake sample project?

Óscar Fuentes ofv at wanadoo.es
Sun Jun 13 08:00:25 PDT 2010

sam lee <skynare at gmail.com> writes:

> Hi,
> I built LLVM on Windows XP through cmake and MinGW make. That was a breeze!
> Now, I wanted to start a project.
> It seems like I need Makefile.rules and Makefile.config to start a new
> project (from http://llvm.org/docs/Projects.html).

Those files are unrelated to cmake.

> And llvm/projects/sample uses autoconf (or ./configure). Is there cmake
> based sample project available?
> I could not find any from official release. Has any of you written sample
> project template that uses cmake?

Just make a directory under LLVM_ROOT/projects and put your source
there, with a CMakeLists.txt file that contains the right directives
(you can use any of the llvm tools or libraries under LLVM_ROOT/tools or
LLVM_ROOT/lib as an example.) After creating those files, you must
re-invoke cmake for it taking notice of your new project.

Another approach is to build and install LLVM and write your project as
an standalone source tree outside LLVM's. Then link the LLVM libraries
into your executable.


More information about the llvm-dev mailing list