Oscar Fuentes | afbe975 | 2009-03-06 01:16:52 +0000 | [diff] [blame] | 1 | # Discover the projects that use CMake in the subdirectories. |
| 2 | # Note that explicit cmake invocation is required every time a new project is |
| 3 | # added or removed. |
| 4 | file(GLOB entries *) |
| 5 | foreach(entry ${entries}) |
| 6 | if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt) |
Chandler Carruth | 276abc5 | 2012-06-27 00:30:08 +0000 | [diff] [blame] | 7 | if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND |
| 8 | (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx)) |
Daniel Dunbar | e0b374b | 2010-01-22 18:14:27 +0000 | [diff] [blame] | 9 | add_subdirectory(${entry}) |
| 10 | endif() |
Oscar Fuentes | afbe975 | 2009-03-06 01:16:52 +0000 | [diff] [blame] | 11 | endif() |
| 12 | endforeach(entry) |
Chandler Carruth | 0c94f5e | 2012-08-29 00:38:02 +0000 | [diff] [blame] | 13 | |
Chandler Carruth | 408b4fa | 2013-09-28 18:17:10 +0000 | [diff] [blame^] | 14 | # Also add in libc++ and compiler-rt trees if present (and we have |
| 15 | # a sufficiently recent version of CMake where required). |
Alexey Samsonov | db171ea | 2013-03-05 14:43:07 +0000 | [diff] [blame] | 16 | if(${LLVM_BUILD_RUNTIME}) |
Chandler Carruth | 408b4fa | 2013-09-28 18:17:10 +0000 | [diff] [blame^] | 17 | add_llvm_external_project(libcxx) |
Alexey Samsonov | db171ea | 2013-03-05 14:43:07 +0000 | [diff] [blame] | 18 | if(${CMAKE_VERSION} VERSION_GREATER 2.8.7) |
| 19 | add_llvm_external_project(compiler-rt) |
| 20 | else() |
| 21 | message(WARNING "Can't build compiler-rt, CMake 2.8.8 required!") |
| 22 | endif() |
Chandler Carruth | 0c94f5e | 2012-08-29 00:38:02 +0000 | [diff] [blame] | 23 | endif() |