blob: de06b78423c575d3cf2a05a9a21060ed5a32482b [file] [log] [blame]
Oscar Fuentesafbe9752009-03-06 01:16:52 +00001# 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.
4file(GLOB entries *)
5foreach(entry ${entries})
6 if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt)
Chandler Carruth276abc52012-06-27 00:30:08 +00007 if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND
8 (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx))
Daniel Dunbare0b374b2010-01-22 18:14:27 +00009 add_subdirectory(${entry})
10 endif()
Oscar Fuentesafbe9752009-03-06 01:16:52 +000011 endif()
12endforeach(entry)
Chandler Carruth0c94f5e2012-08-29 00:38:02 +000013
Chandler Carruth408b4fa2013-09-28 18:17:10 +000014# Also add in libc++ and compiler-rt trees if present (and we have
15# a sufficiently recent version of CMake where required).
Alexey Samsonovdb171ea2013-03-05 14:43:07 +000016if(${LLVM_BUILD_RUNTIME})
Chandler Carruth408b4fa2013-09-28 18:17:10 +000017 add_llvm_external_project(libcxx)
Alexey Samsonovdb171ea2013-03-05 14:43:07 +000018 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 Carruth0c94f5e2012-08-29 00:38:02 +000023endif()