This isn't meant to be a sample, but I can share with you the cmake files I use for my compiler. It builds in both windows user MSVC, and linux using G++, but should work with MinGW.<div><br></div><div>the structure is</div>
<div><br></div><div>src/</div><div> CMakeLists.txt # root make file</div><div> front/</div><div> CMakeLists.txt # library <br><div> middle/</div><div> CMakeLists.txt # library<br></div><div><div> back/</div><div>
CMakeLists.txt # library<br></div></div><div><div><div> npp/</div><div> CMakeLists.txt # executable<br></div></div></div><div><br></div><div><br></div><div><br></div><div class="gmail_quote">On Sun, Jun 13, 2010 at 8:00 AM, Óscar Fuentes <span dir="ltr"><<a href="mailto:ofv@wanadoo.es">ofv@wanadoo.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">sam lee <<a href="mailto:skynare@gmail.com">skynare@gmail.com</a>> writes:<br>
<br>
> Hi,<br>
><br>
> I built LLVM on Windows XP through cmake and MinGW make. That was a breeze!<br>
> Now, I wanted to start a project.<br>
> It seems like I need Makefile.rules and Makefile.config to start a new<br>
> project (from <a href="http://llvm.org/docs/Projects.html" target="_blank">http://llvm.org/docs/Projects.html</a>).<br>
<br>
</div>Those files are unrelated to cmake.<br>
<div class="im"><br>
> And llvm/projects/sample uses autoconf (or ./configure). Is there cmake<br>
> based sample project available?<br>
> I could not find any from official release. Has any of you written sample<br>
> project template that uses cmake?<br>
<br>
</div>Just make a directory under LLVM_ROOT/projects and put your source<br>
there, with a CMakeLists.txt file that contains the right directives<br>
(you can use any of the llvm tools or libraries under LLVM_ROOT/tools or<br>
LLVM_ROOT/lib as an example.) After creating those files, you must<br>
re-invoke cmake for it taking notice of your new project.<br>
<br>
Another approach is to build and install LLVM and write your project as<br>
an standalone source tree outside LLVM's. Then link the LLVM libraries<br>
into your executable.<br>
<br>
[snip]<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>