+macro(add_llvm_tool_subdirectory name)
+ list(APPEND LLVM_IMPLICIT_PROJECT_IGNORE "${CMAKE_CURRENT_SOURCE_DIR}/${name}")
+ add_subdirectory(${name})
+endmacro(add_llvm_tool_subdirectory)
+
+macro(ignore_llvm_tool_subdirectory name)
+ list(APPEND LLVM_IMPLICIT_PROJECT_IGNORE "${CMAKE_CURRENT_SOURCE_DIR}/${name}")
+endmacro(ignore_llvm_tool_subdirectory)
+
+function(add_llvm_implicit_external_projects)
+ set(list_of_implicit_subdirs "")
+ file(GLOB sub-dirs "${CMAKE_CURRENT_SOURCE_DIR}/*")
+ foreach(dir ${sub-dirs})
+ if(IS_DIRECTORY "${dir}")
+ list(FIND LLVM_IMPLICIT_PROJECT_IGNORE "${dir}" tool_subdir_ignore)
+ if( tool_subdir_ignore EQUAL -1
+ AND EXISTS "${dir}/CMakeLists.txt")
+ get_filename_component(fn "${dir}" NAME)
+ list(APPEND list_of_implicit_subdirs "${fn}")
+ endif()
+ endif()
+ endforeach()
+
+ foreach(external_proj ${list_of_implicit_subdirs})
+ add_llvm_external_project("${external_proj}")
+ endforeach()
+endfunction(add_llvm_implicit_external_projects)
+