Oscar Fuentes | c03d2ca | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 1 | macro(add_clang_library name) |
Cédric Venet | f2525e4 | 2008-11-02 16:28:53 +0000 | [diff] [blame^] | 2 | set(srcs ${ARGN}) |
| 3 | if(MSVC_IDE) |
| 4 | file( GLOB_RECURSE headers *.h) |
| 5 | set(srcs ${srcs} ${headers}) |
| 6 | string( REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR}) |
| 7 | list( GET split_path -1 dir) |
| 8 | file( GLOB_RECURSE headers ../../include/clang${dir}/*.h) |
| 9 | set(srcs ${srcs} ${headers}) |
| 10 | endif(MSVC_IDE) |
| 11 | add_library( ${name} ${srcs} ) |
Oscar Fuentes | c03d2ca | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 12 | if( LLVM_COMMON_DEPENDS ) |
| 13 | add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) |
| 14 | endif( LLVM_COMMON_DEPENDS ) |
| 15 | install(TARGETS ${name} |
| 16 | LIBRARY DESTINATION lib |
| 17 | ARCHIVE DESTINATION lib) |
| 18 | endmacro(add_clang_library) |
| 19 | |
| 20 | macro(add_clang_executable name) |
Cédric Venet | f2525e4 | 2008-11-02 16:28:53 +0000 | [diff] [blame^] | 21 | set(srcs ${ARGN}) |
| 22 | if(MSVC_IDE) |
| 23 | file( GLOB_RECURSE headers *.h) |
| 24 | set(srcs ${srcs} ${headers}) |
| 25 | endif(MSVC_IDE) |
| 26 | add_llvm_executable( ${name} ${srcs} ) |
Oscar Fuentes | c03d2ca | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 27 | install(TARGETS ${name} |
| 28 | RUNTIME DESTINATION bin) |
| 29 | endmacro(add_clang_executable) |
| 30 | |
| 31 | include_directories( |
| 32 | ${CMAKE_CURRENT_SOURCE_DIR}/include |
| 33 | ) |
| 34 | |
| 35 | add_definitions( -D_GNU_SOURCE ) |
| 36 | |
| 37 | add_subdirectory(lib) |
| 38 | add_subdirectory(Driver) |
| 39 | |
| 40 | # TODO: docs. |