Initial support for the CMake build system.
[oota-llvm.git] / tools / llvmc2 / CMakeLists.txt
1 set(LLVM_LINK_COMPONENTS support system)
2 set(LLVM_REQUIRES_EH 1)
3
4 macro(tgen ofn)
5   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
6     COMMAND tblgen ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_SOURCE_DIR}/lib/Target -I ${llvm_include_path} ${CMAKE_CURRENT_SOURCE_DIR}/Graph.td -o ${ofn}
7     DEPENDS
8     tblgen
9     ${CMAKE_CURRENT_SOURCE_DIR}/Common.td
10     ${CMAKE_CURRENT_SOURCE_DIR}/Graph.td
11     ${CMAKE_CURRENT_SOURCE_DIR}/Tools.td
12     COMMENT "Building ${ofn}..."
13     )
14 endmacro(tgen ofn)
15
16 tgen(AutoGenerated.inc -gen-llvmc)
17
18 add_custom_target(AutoGenerated_ct echo Tablegenning
19   DEPENDS
20   ${CMAKE_CURRENT_BINARY_DIR}/AutoGenerated.inc
21   )
22
23 include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
24
25 add_llvm_tool(llvmc2
26   Action.cpp
27   AutoGenerated.cpp
28   CompilationGraph.cpp
29   llvmc.cpp
30   )
31
32 add_dependencies(llvmc2 AutoGenerated_ct)