[LLVMdev] how to compile my LLVM project with CMake (on Windows)?

254 views
Skip to first unread message

Jun Koi

unread,
Aug 10, 2012, 1:06:15 PM8/10/12
to llv...@cs.uiuc.edu
hi,

i already successfully compiled & installled LLVM 3.1 on Windows (with
CMake & Visual Studio 2008). next, i am trying to understand how to
create a standalone LLVM project, and compile that on Windows (also
using CMake & Visual Studio 2008).

to start, i picked up the "examples\BrainF" project, renamed it to
"examples\BrainF2" (and i still put BrainF2 under the same examples\
directory)

next, inside BrainF2, i run on Windows console:

c:\llvm-3.1\examples\BrainF2\> cmake -G "Visual Studio 9 2008"

but then cmake complains error like "unknown CMake command add_llvm_example"

so i guess what i did is totally wrong. but i cannot find any doc
mentioning how to compile a project with CMake.

any help, please?
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Óscar Fuentes

unread,
Aug 10, 2012, 11:11:27 PM8/10/12
to Jun Koi, llv...@cs.uiuc.edu
Jun Koi <junko...@gmail.com> writes:

> i already successfully compiled & installled LLVM 3.1 on Windows (with
> CMake & Visual Studio 2008). next, i am trying to understand how to
> create a standalone LLVM project, and compile that on Windows (also
> using CMake & Visual Studio 2008).

Please read

http://www.llvm.org/docs/CMake.html#embedding-llvm-in-your-project

but instead of using the include_directories and link_directories as
explained on that document, use:

include_directories( ${LLVM_ROOT}/include )
link_directories( ${LLVM_ROOT}/lib )

[snip]
Reply all
Reply to author
Forward
0 new messages