Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 1 | macro(add_clang_library name) |
Cedric Venet | fe2f808 | 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 | d2f4e5e | 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) |
Cedric Venet | fe2f808 | 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 | d2f4e5e | 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 | |
Chris Lattner | bc6ec75 | 2008-11-11 18:39:10 +0000 | [diff] [blame] | 35 | install(DIRECTORY include |
| 36 | DESTINATION . |
| 37 | PATTERN ".svn" EXCLUDE |
| 38 | ) |
| 39 | |
Oscar Fuentes | d2f4e5e | 2008-10-26 00:56:18 +0000 | [diff] [blame] | 40 | add_definitions( -D_GNU_SOURCE ) |
| 41 | |
| 42 | add_subdirectory(lib) |
| 43 | add_subdirectory(Driver) |
| 44 | |
| 45 | # TODO: docs. |