Index: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake =================================================================== --- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake +++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake @@ -43,21 +43,16 @@ return() endif() - if (NOT EXISTS ${LLVM_MAIN_SRC_DIR}) - set(LLVM_FOUND OFF) - message(WARNING "Not found: ${LLVM_MAIN_SRC_DIR}") - return() - endif() - - if(NOT EXISTS ${LLVM_CMAKE_PATH}) + if (EXISTS "${LLVM_CMAKE_PATH}") + list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") + elseif (EXISTS "${LLVM_MAIN_SRC_DIR}/cmake/modules") + list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules") + else() set(LLVM_FOUND OFF) - message(WARNING "Not found: ${LLVM_CMAKE_PATH}") + message(WARNING "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found") return() endif() - list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") - list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules") - set(LLVM_FOUND ON) endmacro(find_llvm_parts)